<template>
  <div class="container">
    <div class="main">
      <!-- <div class="header">
        <div class="title">数字水运</div>
      </div>  -->
      <div class="content" v-show="!isShow">
        <div class="left-content">
          <div class="item-content" style="margin: 40px">
            <div class="item-content-title">整体情况-北江船闸</div>
            <div style="display: flex">
              <div class="item" style="width: 33.33%; margin: 30px 24px 24px 28px">
                <div class="top">
                  <div class="title">实时水位统计分析</div>
                  <div class="time">
                    时间：{{ new Date().format("yyyy年MM月dd日hh时") }}
                  </div>
                  <div class="shimmer-container">
                    <slot></slot>
                  </div>
                </div>
                <div id="first-chart"></div>
              </div>
              <div class="item" style="width: 33.33%; margin: 30px 24px 24px 0px">
                <div class="top">
                  <div class="icon-background">
                    <img src="@/assets/images/pc/xiala-icon.png" alt="图标" class="icon" />
                  </div>
                  <div class="title">过闸船舶货物吨位统计分析</div>
                  <el-date-picker v-model="year" type="year" :clearable="false" value-format="YYYY" @change="yearChange"
                    placeholder="请选择年份" style="width: 100px" />
                  <div class="shimmer-container">
                    <slot></slot>
                  </div>
                </div>
                <div class="count">
                  <div class="count-item">
                    <span class="name">总上行船舶数（艘）</span>
                    <span class="value">{{ animatedValues.totalUpShipNum1.toFixed(0) }}</span>
                  </div>
                  <div class="count-item">
                    <span class="name">总下行船舶数（艘）</span>
                    <span class="value">{{ animatedValues.totalDownShipNum1.toFixed(0) }}</span>
                  </div>
                </div>
                <div id="second-chart"></div>
              </div>
              <div class="item" style="width: 33.33%; margin: 30px 24px 24px 0px">
                <div class="top">
                  <div class="icon-background1">
                    <img src="@/assets/images/pc/xiala-icon.png" alt="图标" class="icon" />
                  </div>
                  <div class="title">过闸船舶货物类型统计分析</div>
                  <el-date-picker v-model="date" type="daterange" :clearable="false" value-format="YYYY-MM-DD"
                    range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="dateChange"
                    style="width: 129px;margin-left: 10px;" />
                  <div class="shimmer-container">
                    <slot></slot>
                  </div>
                </div>
                <div id="third-chart"></div>
                <div class="pie-table">
                  <div class="pie-tbody">
                    <div class="pie-tr" v-for="(item, index) in pieChartData" :key="index">
                      <div style="display: flex; align-items: center; width: 40%">
                        <div class="li" :style="`background:${
                            item.itemStyle ? item.itemStyle.color : ''
                          }`">
                        </div>
                        <div class="pie-td" style="flex: 1;">{{ item.name }}</div>
                        <div class="pie-td" style="width: 20%;">{{ item.load }} 吨</div>
                        <div class="pie-td" style="width: 20%;">{{ item.value }}%</div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="item-content" style="margin: 0px 40px 40px 40px">
            <div class="item-content-title">
              <div class="one-ship">单个船闸情况</div>
              <el-select v-model="shipLock" @change="shipLockChange()" placeholder="请选择船闸" style="width: 237px">
                <el-option v-for="item in shipLockOptions" :key="item.name" :label="item.name" :value="item.name" />
              </el-select>
            </div>
            <div style="display: flex">
              <div class="item" style="width: 50%; margin: 30px 24px 24px 28px">
                <div class="top" style="justify-content: unset">
                  <div class="title" :class="currentTab === 1 ? '' : 'no-active'" @click="currentTab = 1">
                    过闸船舶统计分析
                  </div>
                  <div class="title" :class="currentTab === 2 ? '' : 'no-active'" @click="currentTab = 2">
                    水位变化统计
                  </div>
                  <div class="shimmer-container1">
                    <slot></slot>
                  </div>
                </div>

                <div class="tab-content" v-show="currentTab === 1">
                  <div class="radio-value">
                    <el-radio-group class="groups" v-model="radioValue" @change="radioValueChange">
                      <el-radio-button label="北江船闸过闸船舶货物吨位统计分析" value="北江船闸过闸船舶货物吨位统计分析" />
                      <el-radio-button label="北江船闸过闸船舶货物类型统计分析" value="北江船闸过闸船舶货物类型统计分析" />
                    </el-radio-group>
                  </div>
                  <div class="count" v-show="radioValue === '北江船闸过闸船舶货物吨位统计分析'">
                    <el-date-picker v-model="year1" type="year" :clearable="false" value-format="YYYY"
                      @change="year1Change" placeholder="请选择年份" style="width: 100px" />
                    <div class="count-item">
                      <span class="name">总上行船舶数（艘）</span>
                      <span class="value">{{ animatedValues.totalUpShipNum1.toFixed(0)}}</span>
                    </div>
                    <div class="count-item">
                      <span class="name">总下行船舶数（艘）</span>
                      <span class="value">{{ animatedValues.totalDownShipNum1.toFixed(0)}}</span>
                    </div>
                  </div>
                  <div id="sixth-chart" v-show="radioValue === '北江船闸过闸船舶货物吨位统计分析'"></div>
                  <div class="date" v-show="radioValue === '北江船闸过闸船舶货物类型统计分析'">
                    <el-date-picker v-model="date1" type="daterange" :clearable="false" value-format="YYYY-MM-DD"
                      range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="date1Change"
                      style="width: 200px" />
                  </div>
                  <div style="display: flex" v-show="radioValue === '北江船闸过闸船舶货物类型统计分析'">
                    <div id="seventh-chart"></div>
                    <div class="pie-table" style="height: 300px; display: flex; align-items: center">
                      <div class="pie-tbody1" style="width: 300px">
                        <div class="pie-tr" v-for="(item, index) in pieChartData1" :key="index">
                          <div style="
                              display: flex;
                              align-items: center;
                              width: 40%;
                            ">
                            <div class="li" :style="`background:${
                                item.itemStyle ? item.itemStyle.color : ''
                              }`"></div>
                            <div class="pie-td">{{ item.name }}</div>
                          </div>
                          <div class="pie-td" style="width: 30%">
                            {{ item.load }}吨
                          </div>
                          <div class="pie-td" style="width: 30%">
                            {{ item.value }}%
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="tab-content" v-show="currentTab === 2">
                  <div class="date">
                    水位日期：
                    <el-date-picker v-model="waterLevelDate" type="date" value-format="YYYY-MM-DD" :clearable="false"
                      @change="waterLevelDateChange" placeholder="请选择日期" style="width: 140px" />
                  </div>
                  <div id="eighth-chart"></div>
                </div>
              </div>
              <div class="item" style="width: 50%; margin: 30px 24px 24px 0px">
                <div class="top">
                  <div class="title">实时视频监控</div>
                  <el-select v-model="videoPoint" @change="videoPointChange" placeholder="请选择视频点" style="width: 214px">
                    <el-option v-for="item in videoDirectoryData" :key="item.id" :label="item.name" :value="item.id" />
                  </el-select>
                  <div class="shimmer-container1">
                    <slot></slot>
                  </div>
                </div>
                <div style="height: 342px" v-show="videoDirectoryData.length">
                  <video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered"
                    style="object-fit: fill; width: 100%; height: 100%"></video>
                </div>
                <div class="no-video" style="" v-if="videoDirectoryData.length === 0">
                  <div class="default-img">
                    <img src="../assets/images/big-screen/no-data.png" alt="" />
                  </div>
                  <div class="default-text">暂无视频</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="centre-content">
          <OlArc ref="OlArcRef"></OlArc>
          <div class="special-topic">
            <div class="topic" @click="
                router.push({
                  path: '/traffic-channel/szsy/big-screen/bigScreen',
                })
              ">
              数字水运
            </div>
            <div class="topic-active">闸坝智能调度与安全监测</div>
            <div class="topic" @click="
                router.push({
                  path: '/traffic-channel/szsy/big-screen/bigScreenQiaoqu',
                })
              ">
              水上桥区管控
            </div>
            <div class="topic" @click="isShow = true">
              琼州海峡保畅通系统联动
            </div>
          </div>
          <div class="legend">
            <div class="legend-item">
              <img src="../assets/images/big-screen/icon-beijiang.png" alt="" />
              <div>北江船闸</div>
            </div>
            <div class="legend-item">
              <img src="../assets/images/big-screen/icon-lianjiang.png" alt="" />
              <div>连江船闸</div>
            </div>
          </div>
          <div class="filter">
            <div class="filter-item" style="margin: 20px 24px">
              <!-- <el-checkbox
                v-model="checkAll1"
                :indeterminate="isIndeterminate1"
                @change="handleCheckAllChange1"
              >
                船闸
              </el-checkbox> -->
              <div class="name">船闸</div>
              <el-checkbox-group v-model="checkedValues1" @change="handleCheckedCitiesChange1"
                style="display: flex; flex-direction: column; margin-left: 20px">
                <el-checkbox v-for="item in options1" :key="item" :label="item" :value="item">
                  {{ item }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
            <div class="filter-item" style="margin: 0px 24px 20px 24px">
              <!-- <el-checkbox
                v-model="checkAll2"
                :indeterminate="isIndeterminate2"
                @change="handleCheckAllChange2"
              >
                航道
              </el-checkbox> -->
              <div class="name">航道</div>
              <el-checkbox-group v-model="checkedValues2" @change="handleCheckedCitiesChange2"
                style="display: flex; flex-direction: column; margin-left: 20px">
                <el-checkbox v-for="item in options2" :key="item" :label="item" :value="item">
                  {{ item }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
            <div class="filter-item" style="margin: 0px 24px 20px 24px">
              <!-- <el-checkbox
                v-model="checkAll3"
                :indeterminate="isIndeterminate3"
                @change="handleCheckAllChange3"
              >
                辖区
              </el-checkbox> -->
              <div class="name">辖区</div>
              <el-checkbox-group v-model="checkedValues3" @change="handleCheckedCitiesChange3"
                style="display: flex; flex-direction: column; margin-left: 20px">
                <el-checkbox v-for="item in options3" :key="item" :label="item" :value="item">
                  {{ item }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
          <div class="statistics">
            <div class="statistics-item" style="margin-bottom: 16px">
              <div class="top-info">
                北江船闸数，共<span style="color: #78dfff">{{
                  beijiangData.totalNum
                }}</span>个
              </div>
              <div class="bottom-info">
                <div style="margin-right: 62px">
                  <div>Ⅲ级</div>
                  <div class="value">{{ beijiangData.three }}</div>
                </div>
                <div style="margin-right: 62px">
                  <div>Ⅳ级</div>
                  <div class="value">{{ beijiangData.four }}</div>
                </div>
                <div>
                  <div>Ⅴ级</div>
                  <div class="value">{{ beijiangData.five }}</div>
                </div>
              </div>
            </div>
            <div class="statistics-item">
              <div class="top-info">
                连江船闸数，共<span style="color: #78dfff">{{
                  lianjiangData.totalNum
                }}</span>个
              </div>
              <div class="bottom-info">
                <div style="margin-right: 62px">
                  <div>Ⅳ级</div>
                  <div class="value">{{ lianjiangData.four }}</div>
                </div>
                <div>
                  <div>Ⅵ级</div>
                  <div class="value">{{ lianjiangData.six }}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="right-content">
          <div class="item-content" style="margin: 40px">
            <div class="item-content-title">整体情况-连江闸坝</div>
            <div style="display: flex">
              <div class="item" style="margin: 30px 24px 24px 28px">
                <div class="top1">
                  <div class="title">变形监测统计分析</div>
                </div>
                <div class="list">
                  <div class="scroll-container">
                    <div class="scroll-content">
                      <div v-for="(item, index) in deformationData" :key="index" class="list-item">
                        <div class="item-title">{{ item.name }}</div>
                        <div class="item-name">
                          <div>预警数</div>
                          <div>一级</div>
                          <div>二级</div>
                          <div>三级</div>
                        </div>
                        <div class="item-value">
                          <div>{{ item.totalnum }}</div>
                          <div>{{ item.onelevel }}</div>
                          <div>{{ item.twolevel }}</div>
                          <div>{{ item.threelevel }}</div>
                        </div>
                      </div>
                      <!-- 重复内容 -->
                      <div v-for="(item, index) in deformationData" :key="'repeat-' + index" class="list-item">
                        <div class="item-title">{{ item.name }}</div>
                        <div class="item-name">
                          <div>预警数</div>
                          <div>一级</div>
                          <div>二级</div>
                          <div>三级</div>
                        </div>
                        <div class="item-value">
                          <div>{{ item.totalnum }}</div>
                          <div>{{ item.onelevel }}</div>
                          <div>{{ item.twolevel }}</div>
                          <div>{{ item.threelevel }}</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="item" style="margin: 30px 24px 24px 0px">
                <div class="top2">
                  <div class="title">
                    变形监测观测周期统计分析
                    <div class="shimmer-container2">
                      <slot></slot>
                    </div>
                    <el-tooltip effect="dark" content="说明：黄牛、黄燕、青莲、青霜水坝观测周期从2023年7月起观测周期从2月一次调整为8小时一次"
                      placement="right">
                      <img src="../assets/images/big-screen/tips.png" alt="" />
                    </el-tooltip>

                  </div>
                </div>
                <div class="tabs-content">
                  <div class="radio-tab group">
                    <el-radio-group v-model="radio" @change="radioChange">
                      <el-radio-button label="船闸" value="船闸" />
                      <el-radio-button label="水坝" value="水坝" />
                    </el-radio-group>
                  </div>
                  <div id="fourth-chart" v-show="radio === '船闸'"></div>
                  <div id="fifth-chart" v-show="radio === '水坝'"></div>
                </div>
              </div>
            </div>
          </div>
          <div class="item-content" style="margin: 0px 40px 40px 40px">
            <div class="item-content-title">
              <div>单个闸坝情况</div>
              <el-cascader v-model="shipLock1" :options="shipLockOptions1" :show-all-levels="false"
                @change="shipLock1Change" style="margin-left: 20px" />
            </div>
            <div style="display: flex">
              <div class="item" style="margin: 30px 24px 24px 28px">
                <div class="top">
                  <div class="title">变形监测分析</div>
                  <el-radio-group v-model="radio1" @change="radio1Change">
                    <el-radio-button label="监测点数据分析" value="监测点数据分析" />
                    <el-radio-button label="变形监测统计分析" value="变形监测统计分析" />
                    <el-radio-button label="变形监测观测周期统计" value="变形监测观测周期统计" />
                  </el-radio-group>
                  <div class="shimmer-container1">
                    <slot></slot>
                  </div>
                </div>
                <div class="tabs-content" style="height: 342px">
                  <div class="point-statistics" v-show="radio1 === '监测点数据分析'">
                    <div style="display: flex; margin-bottom: 24px">
                      <div class="point-item h195 mr24">
                        <div class="top-part">
                          <img src="../assets/images/big-screen/point-one.png" alt="" />
                          <div class="ml16">上月水坝单周期最大变形量</div>
                        </div>
                        <div class="bottom-part">
                          <div class="mr60">
                            <div class="name">平面(mm)</div>
                            <div class="value">
                              {{
                                defInfoData && defInfoData.plane
                                  ? `${ animatedValues.plane1.toFixed(0)}`
                                  : "--"
                              }}
                            </div>
                          </div>
                          <div>
                            <div class="name">高程(mm)</div>
                            <div class="value">
                              {{
                                defInfoData && defInfoData.elevation
                                  ? `${ animatedValues.elevation1.toFixed(0)}`
                                  : "--"
                              }}
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="point-item h195">
                        <div class="top-part">
                          <img src="../assets/images/big-screen/point-two.png" alt="" />
                          <div class="ml16">上月水坝累计变形量</div>
                        </div>
                        <div class="bottom-part1">
                          <div class="mr60">
                            <div class="name">水平方向(mm)</div>
                            <div class="value">
                              {{
                                defInfoData && defInfoData.lastMonthpm
                                  ? `＜${ animatedValues.lastMonthpm1.toFixed(0)}`
                                  : "--"
                              }}
                            </div>
                          </div>
                          <div>
                            <div class="name">垂直方向(mm)</div>
                            <div class="value">
                              {{
                                defInfoData && defInfoData.lastMonthgc
                                  ? `＜${animatedValues.lastMonthgc1.toFixed(0)}`
                                  : "--"
                              }}
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div style="display: flex">
                      <div class="point-item h125 mr24">
                        <div class="top-part">
                          <img src="../assets/images/big-screen/point-three.png" alt="" />
                          <div class="ml16">水坝变形监测点数量(个)</div>
                          <div class="value" style="margin-left: 4px">
                            {{
                              defInfoData && defInfoData.pointNum
                                ? `${ animatedValues.pointNum1.toFixed(0)}`
                                : "--"
                            }}
                          </div>
                        </div>
                      </div>
                      <div class="point-item h125">
                        <div class="top-part">
                          <img src="../assets/images/big-screen/point-four.png" alt="" />
                          <div class="ml16">水坝测站布置情况</div>
                          <div class="name">
                            {{
                              (defInfoData &&  animatedValues.arrangeSit1.toFixed(0)) || "--"
                            }}
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="analysis" v-show="radio1 === '变形监测统计分析'">
                    <div class="top-part">
                      <div class="btn-group">
                        <el-radio class="btn" :class="currentActive === 1 ? 'active' : ''"
                          @click="currentActiveChange(1)">
                          多点单周期图
                        </el-radio>
                        <el-radio class="btn" :class="currentActive === 2 ? 'active' : ''"
                          @click="currentActiveChange(2)">
                          单点多周期图
                        </el-radio>
                      </div>
                      <div v-if="currentActive === 1" class="content-container">
                        <el-input v-model="cycle1" disabled style="width: 100px; margin-right: 10px" />
                        <el-select v-model="cycle" @change="cycleChange" placeholder="选择周期" style="width: 100px">
                          <el-option v-for="item in cycleOptions" :key="item.cycName" :label="item.cycName"
                            :value="item.cycName" />
                        </el-select>
                        <div class="my-btn">
                          <div class="btn" :class="currentType1 === '本次' ? 'active' : ''" @click="changeType1('本次')">
                            本次
                          </div>
                          <div class="btn" :class="currentType1 === '累积' ? 'active' : ''" @click="changeType1('累积')">
                            累积
                          </div>
                        </div>
                      </div>
                      <div v-if="currentActive === 2" class="content-container">
                        <el-select v-model="pointName" placeholder="请选择点" @change="singleValueChange"
                          style="width: 80px; margin-right: 10px">
                          <el-option v-for="item in pointNameData" :key="item.value" :label="item.text"
                            :value="item.value" />
                        </el-select>
                        <el-select v-model="singleType" placeholder="请选择类型" @change="singleValueChange"
                          style="width: 80px; margin-right: 10px">
                          <el-option v-for="item in singleTypeData" :key="item.value" :label="item.text"
                            :value="item.value" />
                        </el-select>
                        <el-select v-model="singleValue1" placeholder="选择周期" v-if="singleType === '周期'"
                          @change="singleValueChange" style="width: 100px; margin-right: 10px">
                          <el-option v-for="item in cycleOptions" :key="item.cycName" :label="item.cycName"
                            :value="item.cycName" />
                        </el-select>
                        <el-select v-model="singleValue2" placeholder="选择周期" v-if="singleType === '周期'"
                          @change="singleValueChange" style="width: 100px">
                          <el-option v-for="item in cycleOptions" :key="item.cycName" :label="item.cycName"
                            :value="item.cycName" />
                        </el-select>
                        <el-date-picker v-model="singleTime" type="daterange" :clearable="false"
                          value-format="YYYY-MM-DD" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
                          @change="singleValueChange" style="width: 180px" v-if="singleType === '时间'" />
                        <div class="my-btn">
                          <div class="btn" :class="currentType2 === '本次' ? 'active' : ''" @click="changeType2('本次')">
                            本次
                          </div>
                          <div class="btn" :class="currentType2 === '累积' ? 'active' : ''" @click="changeType2('累积')">
                            累积
                          </div>
                        </div>
                      </div>
                    </div>
                    <div id="ninth-chart" style="height: 300px; width: 724px; margin-top: 16px"></div>
                  </div>
                  <div id="tenth-chart" v-show="radio1 === '变形监测观测周期统计'"></div>
                </div>
              </div>
              <div class="item" style="margin: 30px 24px 24px 0px">
                <div class="top">
                  <div class="title">实时视频监控</div>
                  <el-select v-model="videoPoint1" @change="videoPointChange1" placeholder="请选择视频点"
                    style="width: 210px">
                    <el-option v-for="item in videoDirectoryData1" :key="item.id" :label="item.name" :value="item.id" />
                  </el-select>
                  <div class="shimmer-container1">
                    <slot></slot>
                  </div>
                </div>
                <div class="video" style="height: 342px" v-show="videoDirectoryData1.length">
                  <video id="myVideo1" class="video-js vjs-default-skin vjs-big-play-centered"
                    style="object-fit: fill; width: 100%; height: 100%"></video>
                </div>
                <div class="no-video" style="" v-if="videoDirectoryData1.length === 0">
                  <div class="default-img">
                    <img src="../assets/images/big-screen/no-data.png" alt="" />
                  </div>
                  <div class="default-text">暂无视频</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="my-iframe" v-if="isShow">
        <!-- <iframe src="https://210.76.81.180//traffic-channel/pre-yzy/szgktymhkb/digital-port/big-screen/main/#/QZHXN?token=10b4040ca79c4661b8ace01a203c516e" width="5760" height="1200"></iframe> -->
        <iframe
          src="https://210.76.81.180/traffic-channel/szgktymhkb/digital-port/big-screen/main/#/QZHX?token=10b4040ca79c4661b8ace01a203c516e"
          width="5760" height="1200"></iframe>
        <div class="close-btn" @click="isShow = false">返回</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, nextTick, reactive, onUnmounted } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();

import * as echarts from "echarts/core";
import {
  TooltipComponent,
  LegendComponent,
  GridComponent,
  DataZoomComponent,
  GraphicComponent,
} from "echarts/components";
import { PieChart, BarChart, LineChart } from "echarts/charts";
import { CanvasRenderer } from "echarts/renderers";

echarts.use([
  TooltipComponent,
  LegendComponent,
  GridComponent,
  DataZoomComponent,
  GraphicComponent,
  PieChart,
  BarChart,
  LineChart,
  CanvasRenderer,
]);

import videojs from "video.js";
import "video.js/dist/video-js.css";
import VideojsZhcnLanguage from "video.js/dist/lang/zh-CN.json";
videojs.addLanguage("zh-CN", VideojsZhcnLanguage);
//地图
import OlArc from "../components/olArcBigScreen.vue";
const OlArcRef = ref(null);
import chartBg from "../assets/images/big-screen/chart-bg.png";
//引入接口
import {
  newWater, //实时水位统计分析
  goodsTonAlys, //过闸船舶货物吨位统计分析
  goodsAnalysis, //过闸船舶货物类型统计分析
  defAlySmall, //变形监测统计分析
  circleAlys, //变形监测观测周期统计分析
  getShipLock, //获取船闸（北江）
  waterAlys, //水位变化统计
  getShipLockSmall, //获取船闸（连江）
  defInfo, //监测点数据分析
  cycleStatis, //变形监测观测周期统计
  screenMapData, //基本情况
  videoDirectory, //获取视频点
  geVideotUrl, //获取视频URL
  getCycList, //获取周期
  defAyls, //多点单周期图
  defSingleAyls, //单点多周期图
} from "@/bridge-h5/utils/myapi";
//数字滚动
const animatedValues = reactive({
  totalUpShipNum1: 0,
  totalDownShipNum1: 0,
  plane1: 0,
  elevation1: 0,
  lastMonthpm1: 0,
  lastMonthgc1: 0,
  pointNum1: 0,
  arrangeSit1: 0,
})
// 缓动函数 - 二次缓出
const easeOutQuad = (t) => t * (2 - t);
const startAnimation = (targetValue, valueKey, duration = 2000) => {
  const startValue = animatedValues[valueKey];
  const changeValue = targetValue - startValue;
  const startTime = performance.now();

  const animate = (currentTime) => {
    const elapsedTime = currentTime - startTime;
    const progress = Math.min(elapsedTime / duration, 1);
    const easeProgress = easeOutQuad(progress);
    animatedValues[valueKey] = startValue + changeValue * easeProgress;

    if (progress < 1) {
      requestAnimationFrame(animate);
    }
  };

  requestAnimationFrame(animate);
};

//实时水位
const newWaterFunctin = () => {
  nextTick(() => {
    newWater().then((res) => {
      if (res.code === 200) {
        let xAxisData = [];
        let seriesData = [];
        res.data.forEach((item) => {
          xAxisData.push(item.name);
          seriesData.push(item.waterLevel);
        });
        let lineChart = echarts.getInstanceByDom(
          document.getElementById("first-chart")
        );
        if (lineChart != null && lineChart != "" && lineChart != undefined) {
          lineChart.dispose();
        }
        lineChart = echarts.init(document.getElementById("first-chart"));

        let option;
        option = {
          tooltip: {
            trigger: "axis",
            confine: true, //限制在图表区域内
            formatter: function (params) {
              let template = `${params[0].axisValue}<br>`;
              for (let i = 0; i < params.length; i++) {
                let item = params[i];
                template +=
                  item.marker + "水位值: " + item.value + "m" + "<br>";
              }
              return template;
            },
          },
          grid: {
            top: "40px",
            left: "40px",
            right: "15px",
            bottom: "40px",
          },
          dataZoom: [
            {
              show: false,
              type: "inside",
              // maxValueSpan: 8,
              // startValue: 0,
              // endValue: 6,
              zoomLock: false,
            },
          ],
          xAxis: {
            type: "category",
            axisLabel: {
              // rotate: 60,
              color: "#FFFFFF",
              fontSize: "16px",
            },
            data: xAxisData,
          },
          yAxis: {
            type: "value",
            name: "水位（m）",
            nameTextStyle: {
              fontWeight: "500",
              fontSize: "16px",
              color: "#FFFFFF",
              opacity: 0.65,
            },
            axisLabel: {
              color: "#FFFFFF",
              opacity: 0.65,
              fontSize: "16px",
            },
            splitLine: {
              show: true,
              lineStyle: {
                // type:'dashed',
                color: "rgba(255,255,255,0.2)",
              },
            },
          },
          series: [
            {
              data: seriesData,
              type: "bar",
              barWidth: 8,
              itemStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: "#78DFFF" }, // 顶部
                  { offset: 1, color: "rgba(120,223,255,0.2)" }, // 底部
                ]),
              },
            },
          ],
        };
        option && lineChart.setOption(option);
      }
    });
  });
};

//过闸船舶货物吨位统计
const year = ref(new Date().format("yyyy"));
const totalUpShipNum = ref(0);
const totalDownShipNum = ref(0);
const initStackedChart = () => {
  goodsTonAlys("", `${year.value}-01-01`, `${year.value}-12-31`).then((res) => {
    if (res.code === 200 && res.data) {
      totalUpShipNum.value = res.data.totalUpShipNum;
      totalDownShipNum.value = res.data.totalDownShipNum;
      startAnimation(totalUpShipNum.value, 'totalUpShipNum1');
      startAnimation(totalDownShipNum.value, 'totalDownShipNum1');
      let emptyData = [];
      let num1Data = [];
      let num2Data = [];
      let num3Data = [];
      let num4Data = [];
      let upShipNumData = [];
      let downShipNumData = [];
      res.data.tons.forEach((item) => {
        emptyData.push(item.empty);
        num1Data.push(item.num1);
        num2Data.push(item.num2);
        num3Data.push(item.num3);
        num4Data.push(item.num4);
        upShipNumData.push(item.upShipNum);
        downShipNumData.push(item.downShipNum);
      });

      let stackedChart = echarts.getInstanceByDom(
        document.getElementById("second-chart")
      );
      if (
        stackedChart != null &&
        stackedChart != "" &&
        stackedChart != undefined
      ) {
        stackedChart.dispose();
      }
      stackedChart = echarts.init(document.getElementById("second-chart"));
      let option;
      option = {
        tooltip: {
          trigger: "axis",
          confine: true, //限制在图表区域内
          formatter: (params) => {
            let template =
              `<b>${params[0].axisValue}</b><br>` +
              `上行船舶数<b style="float:right;padding-left: 20px;">${upShipNumData[parseInt(params[0].axisValue.split("月")[0]) - 1]
              }艘</b><br>下行船舶数<b style="float:right;padding-left: 20px;">${downShipNumData[
              parseInt(params[0].axisValue.split("月")[0]) - 1
              ]
              }艘</b><br>`;
            let count = 0;
            for (let i = 0; i < params.length; i++) {
              let item = params[i];
              template +=
                item.marker +
                item.seriesName +
                `<b style="float:right;padding-left: 20px;">${item.value}艘</b><br>`;
              count += item.value;
            }
            return (
              template +
              `<b style="position: absolute;top: 10px; right: 10px;">总共：${count}艘</b>`
            );
          },
        },
        legend: {
          type: "scroll",
          itemWidth: 8,
          itemHeight: 8,
          textStyle: {
            fontSize: "16px",
            color: "#FFFFFF",
          },
          pageIconColor: "#FFFFFF", // 翻页按钮的颜色
          pageIconInactiveColor: "#2f4554", // 翻页按钮不激活时（即翻页到头时）的颜色
          pageTextStyle: {
            // 图例页信息的文字样式
            color: "#FFFFFF",
          },
        },
        grid: {
          top: "60px",
          left: "80px",
          right: "20px",
          bottom: "30px",
        },
        xAxis: [
          {
            type: "category",
            axisLabel: {
              interval: 0,
              color: "#FFFFFF",
              fontSize: "16px",
            },
            data: [
              "1月",
              "2月",
              "3月",
              "4月",
              "5月",
              "6月",
              "7月",
              "8月",
              "9月",
              "10月",
              "11月",
              "12月",
            ],
          },
        ],
        yAxis: [
          {
            type: "value",
            name: "船舶数（艘）",
            axisLabel: {
              interval: 0,
              color: "rgba(255,255,255,0.65)",
              fontSize: "16px",
            },
            nameTextStyle: {
              fontWeight: "500",
              fontSize: "16px",
              color: "rgba(255,255,255,0.65)",
            },
            splitLine: {
              show: true,
              lineStyle: {
                // type:'dashed',
                color: "rgba(255,255,255,0.2)",
              },
            },
          },
        ],
        series: [
          {
            name: "空载",
            type: "bar",
            stack: "Search Engine",
            barWidth: 8,
            // showBackground: true,
            emphasis: {
              //折线图的高亮状态。
              focus: "series",
            },
            itemStyle: {
              itemStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: "#78DFFF" }, // 顶部
                  { offset: 1, color: "rgba(120,223,255,0.2)" }, // 底部
                ]),
              },
            },
            data: emptyData,
          },
          {
            name: "0-500吨",
            type: "bar",
            stack: "Search Engine",
            barWidth: "15%",
            // showBackground: true,
            emphasis: {
              focus: "series",
            },
            itemStyle: {
              itemStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: "#309CFF" }, // 顶部
                  { offset: 1, color: "rgba(48,156,255,0.2)" }, // 底部
                ]),
              },
            },
            data: num1Data,
          },
          {
            name: "500-1000吨",
            type: "bar",
            stack: "Search Engine",
            barWidth: "15%",
            // showBackground: true,
            emphasis: {
              focus: "series",
            },
            itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: "#5AF5D5" }, // 顶部
                { offset: 1, color: "rgba(90,245,213,0.2)" }, // 底部
              ]),
            },
            data: num2Data,
          },
          {
            name: "1000-3000吨",
            type: "bar",
            stack: "Search Engine",
            barWidth: "15%",
            // showBackground: true,
            emphasis: {
              focus: "series",
            },
            itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: "#FFC733" }, // 顶部
                { offset: 1, color: "rgba(255,199,51,0.2)" }, // 底部
              ]),
            },
            data: num3Data,
          },
          {
            name: "3000吨以上",
            type: "bar",
            stack: "Search Engine",
            barWidth: "15%",
            // showBackground: true,
            emphasis: {
              focus: "series",
            },
            itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: "#309CFF" }, // 顶部
                { offset: 1, color: "rgba(48,156,255,0.2)" }, // 底部
              ]),
            },
            data: num4Data,
          },
        ],
      };

      option && stackedChart.setOption(option);
    }
  });
};
const yearChange = () => {
  initStackedChart();
};

//过闸船舶货物类型统计分析
// 计算7天前的时间
const sevenDaysAgo = new Date(new Date().getTime() - 6 * 24 * 60 * 60 * 1000);
const sevenDaysAgoFormatted = ref(
  `${sevenDaysAgo.getFullYear()}-${(sevenDaysAgo.getMonth() + 1)
    .toString()
    .padStart(2, "0")}-${sevenDaysAgo.getDate().toString().padStart(2, "0")}`
);
const date = ref([
  sevenDaysAgoFormatted.value,
  new Date().format("yyyy-MM-dd"),
]);
const pieChartData = ref([]);
const initPieChart = () => {
  let start = date.value[0];
  let end = date.value[1];
  goodsAnalysis("", start, end).then((res) => {
    if (res.code === 200) {
      let seriesData = [];
      let colorData = [
        "#78DFFF",
        "#9AD4EF",
        "#309CFF",
        "#2B679D",
        "#5057FD",
        "#8083D8",
        "#5AF5D5",
        "#A6E7D9",
        "#55FE5C",
        "#9CDB9F",
        "#FFC733",
        "#FFE6A5",
        "#FE762A",
        "#F9B793",
        "#E33F3F",
        "#F48787",
        "#ED44F0",
        "#F5ABF6",
        "#41616A",
        "#ADCDD6",
      ];
      res.data.forEach((item, index) => {
        let obj = {
          name: item.cargoType,
          value: item.rate,
          load: item.load,
          itemStyle: {
            color: colorData[index],
          },
        };
        seriesData.push(obj);
      });
      pieChartData.value = seriesData;
      let pieChart = echarts.getInstanceByDom(
        document.getElementById("third-chart")
      );
      if (pieChart != null && pieChart != "" && pieChart != undefined) {
        pieChart.dispose();
      }
      pieChart = echarts.init(document.getElementById("third-chart"));
      let option;
      option = {
        graphic: {
          type: "image",
          id: "background",
          left: 5,
          top: 15,
          z: -10, // 确保背景图在底层
          bounding: "raw",
          origin: [200, 200], // 图片的中心位置
          style: {
            image: chartBg, // 背景图片的URL
            width: 190, // 背景图片的宽度
            height: 190, // 背景图片的高度
          },
        },
        tooltip: {
          trigger: "item",
          confine: true, //限制在图表区域内
          top: 30,
          formatter: function (params) {
            return (
              params.marker +
              params.data.name +
              ": " +
              params.data.load +
              "吨，占比：" +
              params.data.value +
              "%"
            );
          },
        },
        legend: {
          type: "scroll",
          itemWidth: 8,
          itemHeight: 8,
          orient: 'horizontal',
          bottom: 10,
          top:-5,
          textStyle: {
            fontSize: "16px",
            color: "#FFFFFF",
          },
          pageIconColor: "#FFFFFF", // 翻页按钮的颜色
          pageIconInactiveColor: "#2f4554", // 翻页按钮不激活时的颜色
          pageTextStyle: {
            color: "#FFFFFF", // 图例页信息的文字样式
          },
          animation: true,
          pageButtonPosition: 'end',
          pageMode: true,
          scrollDataIndex: 0,
          pageFormatter: '{current}/{total}',
          itemCount: 3,
        },
        series: [
          {
            type: "pie",
            radius: ["50%", "60%"],
            center: ['21%', '50%'],
            avoidLabelOverlap: false,
            label: {
              show: false,
            },
            labelLine: {
              show: true, //标签连接线
            },
            data: seriesData,
          },
        ],
      };
      option && pieChart.setOption(option);

      // 设置自动滚动
      if (window.legendScrollTimer) {
        clearInterval(window.legendScrollTimer);
      }

      // 延迟一点执行以确保图表完全渲染
      setTimeout(() => {
        if (pieChart && !pieChart.isDisposed() && seriesData.length > 3) {
          let currentIndex = 0;
          let isForward = true;
          let maxIndex = Math.max(0, seriesData.length - 3);

          window.legendScrollTimer = setInterval(() => {
            if (pieChart && !pieChart.isDisposed()) {
              pieChart.dispatchAction({
                type: 'legendScroll',
                scrollDataIndex: currentIndex
              });

              if (isForward) {
                currentIndex++;
                if (currentIndex >= maxIndex) {
                  isForward = false;
                }
              } else {
                currentIndex--;
                if (currentIndex <= 0) {
                  isForward = true;
                  currentIndex = 0;
                }
              }
            }
          }, 2000); // 每2秒滚动一次
        }
      }, 500);
    }
  });
};
const dateChange = () => {
  initPieChart();
};

//变形监测统计分析
const deformationData = ref([]);
const deformationAlysFunction = () => {
  defAlySmall().then((res) => {
    if (res.code === 200 && res.data.length) {
      deformationData.value = res.data;
    }
  });
};

//变形监测观测周期统计分析
const radio = ref("船闸");
const radioChange = () => {
  if (radio.value === "船闸") {
    initBarChart1();
  } else if (radio.value === "水坝") {
    initBarChart2();
  }
};
const chuanzhaxAxisData = ref([]);
const chuanzhaseriesData = ref([]);
const shuibaxAxisData = ref([]);
const shuibaseriesData = ref([]);
const circleAlysFunction = () => {
  circleAlys().then((res) => {
    if (res.code === 200) {
      res.data.chuanzha.forEach((item) => {
        chuanzhaxAxisData.value.push(item.name);
        chuanzhaseriesData.value.push({
          value: item.cyc,
          itemStyle: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
              { offset: 0, color: "#78DFFF" }, // 顶部
              { offset: 1, color: "rgba(120,223,255,0.2)" }, // 底部
            ]),
          },
        });
      });
      res.data.shuiba.forEach((item) => {
        shuibaxAxisData.value.push(item.name);
        shuibaseriesData.value.push({
          value: item.cyc,
          itemStyle: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
              { offset: 0, color: "#78DFFF" }, // 顶部
              { offset: 1, color: "rgba(120,223,255,0.2)" }, // 底部
            ]),
          },
        });
      });
      initBarChart1();
      initBarChart2();
    }
  });
};
const initBarChart1 = () => {
  nextTick(() => {
    let barChart = echarts.getInstanceByDom(
      document.getElementById("fourth-chart")
    );
    if (barChart != null && barChart != "" && barChart != undefined) {
      barChart.dispose();
    }
    barChart = echarts.init(document.getElementById("fourth-chart"));
    let option;
    option = {
      tooltip: {
        trigger: "axis",
        confine: true, //限制在图表区域内
        formatter: function (params) {
          let template = `${params[0].axisValue}<br>`;
          for (let i = 0; i < params.length; i++) {
            let item = params[i];
            template += item.marker + " " + item.data.value + " 次" + "<br>";
          }
          return template;
        },
      },

      legend: {},
      grid: {
        top: "40px",
        left: "40px",
        right: "15px",
        bottom: "40px",
      },
      dataZoom: [
        {
          show: false,
          type: "inside",
          // maxValueSpan: 8,
          startValue: 0,
          endValue: 4,
          zoomLock: false,
        },
      ],
      xAxis: {
        type: "category",
        axisLabel: {
          // rotate: 60,
          color: "rgba(255,255,255,0.85)",
          fontSize: "16px",
        },
        data: chuanzhaxAxisData.value,
      },
      yAxis: {
        type: "value",
        name: "统计次数",
        nameTextStyle: {
          fontWeight: "500",
          fontSize: "16px",
          color: "rgba(255,255,255,0.65)",
        },
        axisLabel: {
          color: "rgba(255,255,255,0.65)",
          fontSize: "16px",
        },
        splitLine: {
          show: true,
          lineStyle: {
            // type:'dashed',
            color: "rgba(255,255,255,0.2)",
          },
        },
      },
      series: [
        {
          data: chuanzhaseriesData.value,
          type: "bar",
          barWidth: 10,
        },
      ],
    };

    option && barChart.setOption(option);
  });
};
const initBarChart2 = () => {
  nextTick(() => {
    let barChart = echarts.getInstanceByDom(
      document.getElementById("fifth-chart")
    );
    if (barChart != null && barChart != "" && barChart != undefined) {
      barChart.dispose();
    }
    barChart = echarts.init(document.getElementById("fifth-chart"));
    let option;
    option = {
      tooltip: {
        trigger: "axis",
        confine: true, //限制在图表区域内
        formatter: function (params) {
          let template = `${params[0].axisValue}<br>`;
          for (let i = 0; i < params.length; i++) {
            let item = params[i];
            template += item.marker + " " + item.data.value + " 次" + "<br>";
          }
          return template;
        },
      },
      legend: {},
      grid: {
        top: "40px",
        left: "60px",
        right: "15px",
        bottom: "40px",
      },
      dataZoom: [
        {
          show: false,
          type: "inside",
          // maxValueSpan: 8,
          startValue: 0,
          endValue: 4,
          zoomLock: false,
        },
      ],
      xAxis: {
        type: "category",
        axisLabel: {
          color: "rgba(255,255,255,0.85)",
          fontSize: "16px",
        },
        data: shuibaxAxisData.value,
      },
      yAxis: {
        type: "value",
        name: "统计次数",
        nameTextStyle: {
          fontWeight: "500",
          fontSize: "16px",
          color: "rgba(255,255,255,0.65)",
        },
        axisLabel: {
          color: "rgba(255,255,255,0.65)",
          fontSize: "16px",
        },
        splitLine: {
          show: true,
          lineStyle: {
            // type:'dashed',
            color: "rgba(255,255,255,0.2)",
          },
        },
      },
      series: [
        {
          type: "bar",
          barWidth: 10,
          // showBackground: true,
          data: shuibaseriesData.value,
        },
      ],
    };

    option && barChart.setOption(option);
  });
};

//获取船闸（北江）
const shipLock = ref("");
const shipLockOptions = ref([]);
const getShipLockFunction = () => {
  getShipLock("北江").then((res) => {
    if (res.code === 200 && res.data.length) {
      shipLockOptions.value = res.data;
      shipLock.value = res.data[3].name;
      initStackedChart1();
      initPieChart1();
      waterAlysFunction();
      initVideo(); //视频监控
    }
  });
};
const shipLockChange = () => {
  initStackedChart1();
  initPieChart1();
  waterAlysFunction();
  videoDirectoryFunction(); //视频监控
};
const currentTab = ref(1);

//过闸船舶统计分析
const radioValue = ref("北江船闸过闸船舶货物吨位统计分析");
const radioValueChange = () => { };
//过闸船舶货物吨位统计
const year1 = ref(new Date().format("yyyy"));
const totalUpShipNum1 = ref(0);
const totalDownShipNum1 = ref(0);
const initStackedChart1 = () => {
  goodsTonAlys(
    shipLock.value,
    `${year1.value}-01-01`,
    `${year1.value}-12-31`
  ).then((res) => {
    if (res.code === 200 && res.data) {
      totalUpShipNum1.value = res.data.totalUpShipNum;
      totalDownShipNum1.value = res.data.totalDownShipNum;
      let emptyData = [];
      let num1Data = [];
      let num2Data = [];
      let num3Data = [];
      let num4Data = [];
      let upShipNumData = [];
      let downShipNumData = [];
      res.data.tons.forEach((item) => {
        emptyData.push(item.empty);
        num1Data.push(item.num1);
        num2Data.push(item.num2);
        num3Data.push(item.num3);
        num4Data.push(item.num4);
        upShipNumData.push(item.upShipNum);
        downShipNumData.push(item.downShipNum);
      });

      nextTick(() => {
        let stackedChart = echarts.getInstanceByDom(
          document.getElementById("sixth-chart")
        );
        if (
          stackedChart != null &&
          stackedChart != "" &&
          stackedChart != undefined
        ) {
          stackedChart.dispose();
        }
        stackedChart = echarts.init(document.getElementById("sixth-chart"));
        let option;
        option = {
          tooltip: {
            trigger: "axis",
            confine: true, //限制在图表区域内
            formatter: (params) => {
              // console.log(params)
              let template =
                `<b>${params[0].axisValue}</b><br>` +
                `上行船舶数<b style="float:right;padding-left: 20px;">${upShipNumData[
                parseInt(params[0].axisValue.split("月")[0]) - 1
                ]
                }艘</b><br>下行船舶数<b style="float:right;padding-left: 20px;">${downShipNumData[
                parseInt(params[0].axisValue.split("月")[0]) - 1
                ]
                }艘</b><br>`;
              let count = 0;
              for (let i = 0; i < params.length; i++) {
                let item = params[i];
                template +=
                  item.marker +
                  item.seriesName +
                  `<b style="float:right;padding-left: 20px;">${item.value}艘</b><br>`;
                count += item.value;
              }
              return (
                template +
                `<b style="position: absolute;top: 10px; right: 10px;">总共：${count}艘</b>`
              );
            },
          },
          legend: {
            type: "scroll",
            itemWidth: 8,
            itemHeight: 8,
            textStyle: {
              fontSize: "16px",
              color: "#FFFFFF",
            },
          },
          grid: {
            top: "60px",
            left: "50px",
            right: "20px",
            bottom: "30px",
          },
          xAxis: [
            {
              type: "category",
              axisLabel: {
                interval: 0,
                color: "#FFFFFF",
                fontSize: "16px",
              },
              data: [
                "1月",
                "2月",
                "3月",
                "4月",
                "5月",
                "6月",
                "7月",
                "8月",
                "9月",
                "10月",
                "11月",
                "12月",
              ],
            },
          ],
          yAxis: [
            {
              type: "value",
              name: "船舶数（艘）",
              axisLabel: {
                interval: 0,
                color: "#FFFFFF",
                opacity: 0.65,
                fontSize: "16px",
              },
              nameTextStyle: {
                fontWeight: "500",
                fontSize: "16px",
                opacity: 0.65,
                color: "#FFFFFF",
              },
              splitLine: {
                show: true,
                lineStyle: {
                  // type:'dashed',
                  color: "rgba(255,255,255,0.2)",
                },
              },
            },
          ],
          series: [
            {
              name: "空载",
              type: "bar",
              stack: "Search Engine",
              barWidth: "15%",
              // showBackground: true,
              emphasis: {
                //折线图的高亮状态。
                focus: "series",
              },
              itemStyle: {
                color: "#78DFFF",
              },
              data: emptyData,
            },
            {
              name: "0-500吨",
              type: "bar",
              stack: "Search Engine",
              barWidth: "15%",
              // showBackground: true,
              emphasis: {
                focus: "series",
              },
              itemStyle: {
                itemStyle: {
                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                    { offset: 0, color: "#78DFFF" }, // 顶部
                    { offset: 1, color: "rgba(120,223,255,0.2)" }, // 底部
                  ]),
                },
              },
              data: num1Data,
            },
            {
              name: "500-1000吨",
              type: "bar",
              stack: "Search Engine",
              barWidth: "15%",
              // showBackground: true,
              emphasis: {
                focus: "series",
              },
              itemStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: "#309CFF" }, // 顶部
                  { offset: 1, color: "rgba(48,156,255,0.2)" }, // 底部
                ]),
              },
              data: num2Data,
            },
            {
              name: "1000-3000吨",
              type: "bar",
              stack: "Search Engine",
              barWidth: "15%",
              // showBackground: true,
              emphasis: {
                focus: "series",
              },
              itemStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: " #5AF5D5" }, // 顶部
                  { offset: 1, color: " rgba(90,245,213,0.2)" }, // 底部
                ]),
              },
              data: num3Data,
            },
            {
              name: "3000吨以上",
              type: "bar",
              stack: "Search Engine",
              barWidth: "15%",
              // showBackground: true,
              emphasis: {
                focus: "series",
              },
              itemStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  { offset: 0, color: " #FFC733" }, // 顶部
                  { offset: 1, color: "rgba(120,223,255,0.2)" }, // 底部
                ]),
              },
              data: num4Data,
            },
          ],
        };

        option && stackedChart.setOption(option);
      });
    }
  });
};
const year1Change = () => {
  initStackedChart1();
};
const sevenDaysAgoFormatted1 = ref(
  `${sevenDaysAgo.getFullYear()}-${(sevenDaysAgo.getMonth() + 1)
    .toString()
    .padStart(2, "0")}-${sevenDaysAgo.getDate().toString().padStart(2, "0")}`
);
const date1 = ref([
  sevenDaysAgoFormatted1.value,
  new Date().format("yyyy-MM-dd"),
]);
const pieChartData1 = ref([]);
const initPieChart1 = () => {
  let start = date1.value[0];
  let end = date1.value[1];
  goodsAnalysis(shipLock.value, start, end).then((res) => {
    if (res.code === 200) {
      let seriesData = [];
      let colorData = [
        "#78DFFF",
        "#9AD4EF",
        "#309CFF",
        "#2B679D",
        "#5057FD",
        "#8083D8",
        "#5AF5D5",
        "#A6E7D9",
        "#55FE5C",
        "#9CDB9F",
        "#FFC733",
        "#FFE6A5",
        "#FE762A",
        "#F9B793",
        "#E33F3F",
        "#F48787",
        "#ED44F0",
        "#F5ABF6",
        "#41616A",
        "#ADCDD6",
      ];
      res.data.forEach((item, index) => {
        let obj = {
          name: item.cargoType,
          value: item.rate,
          load: item.load,
          itemStyle: {
            color: colorData[index],
          },
        };
        seriesData.push(obj);
      });
      pieChartData1.value = seriesData;
      let pieChart = echarts.getInstanceByDom(
        document.getElementById("seventh-chart")
      );
      if (pieChart != null && pieChart != "" && pieChart != undefined) {
        pieChart.dispose();
      }
      pieChart = echarts.init(document.getElementById("seventh-chart"));
      let option;
      option = {
        graphic: {
          type: "image",
          id: "background",
          left: 50,
          top: 20,
          z: -10, // 确保背景图在底层
          bounding: "raw",
          origin: [200, 200], // 图片的中心位置
          style: {
            image: chartBg, // 背景图片的URL
            width: 260, // 背景图片的宽度
            height: 260, // 背景图片的高度
          },
        },
        tooltip: {
          trigger: "item",
          confine: true, //限制在图表区域内
          type: scroll,
          formatter: function (params) {
            return (
              params.marker +
              params.data.name +
              ": " +
              params.data.load +
              "吨，占比：" +
              params.data.value +
              "%"
            );
          },
        },
        legend: {
          type: "scroll",
          itemWidth: 8,
          itemHeight: 8,
          orient: 'horizontal',
          bottom: 10,
          top:0,
          textStyle: {
            fontSize: "16px",
            color: "#FFFFFF",
          },
          pageIconColor: "#FFFFFF",
          pageIconInactiveColor: "#2f4554",
          pageTextStyle: {
            color: "#FFFFFF",
          },
          animation: true,
          pageButtonPosition: 'end',
          pageMode: true,
          scrollDataIndex: 0,
          pageFormatter: '{current}/{total}',
          itemCount: 3,
        },
        series: [
          {
            type: "pie",
            radius: ["50%", "60%"],
            avoidLabelOverlap: false,
            label: {
              show: false,
              position: "center",
            },
            data: seriesData,
          },
        ],
      };
      option && pieChart.setOption(option);

      // 设置自动滚动
      if (window.legendScrollTimer1) {
        clearInterval(window.legendScrollTimer1);
      }

      // 延迟一点执行以确保图表完全渲染
      setTimeout(() => {
        if (pieChart && !pieChart.isDisposed() && seriesData.length > 3) {
          let currentIndex = 0;
          let isForward = true;
          let maxIndex = Math.max(0, seriesData.length - 3);

          window.legendScrollTimer1 = setInterval(() => {
            if (pieChart && !pieChart.isDisposed()) {
              pieChart.dispatchAction({
                type: 'legendScroll',
                scrollDataIndex: currentIndex
              });

              if (isForward) {
                currentIndex++;
                if (currentIndex >= maxIndex) {
                  isForward = false;
                }
              } else {
                currentIndex--;
                if (currentIndex <= 0) {
                  isForward = true;
                  currentIndex = 0;
                }
              }
            }
          }, 2000); // 每2秒滚动一次
        }
      }, 500);
    }
  });
};


const date1Change = () => {
  initPieChart1();
};


//水位变化统计
const waterLevelDate = ref("");
const waterAlysFunction = () => {
  nextTick(() => {
    waterAlys(shipLock.value, waterLevelDate.value).then((res) => {
      if (res.code === 200) {
        let xAxisData = [];
        let seriesData = [];
        res.data.forEach((item) => {
          xAxisData.push(item.logDate.slice(11, 16));
          seriesData.push(item.waterLevel);
        });
        let lineChart = echarts.getInstanceByDom(
          document.getElementById("eighth-chart")
        );
        if (lineChart != null && lineChart != "" && lineChart != undefined) {
          lineChart.dispose();
        }
        lineChart = echarts.init(document.getElementById("eighth-chart"));

        let option;
        option = {
          tooltip: {
            trigger: "axis",
            confine: true, //限制在图表区域内
            formatter: function (params) {
              let template = `${params[0].axisValue}<br>`;
              for (let i = 0; i < params.length; i++) {
                let item = params[i];
                template +=
                  item.marker + "水位值: " + item.value + "m" + "<br>";
                // return params[x].data.name + ':' + params[x].data.value
              }
              return template;
            },
          },
          grid: {
            top: "40px",
            left: "40px",
            right: "12%",
            bottom: "45px",
          },
          dataZoom: [
            {
              show: false,
              type: "inside",
              startValue: 0,
              endValue: 11,
              zoomLock: false,
            },
          ],
          xAxis: {
            type: "category",
            name: "时间",
            data: xAxisData,
            nameTextStyle: {
              fontWeight: "500",
              fontSize: "16px",
              color: "#FFFFFF",
            },
            axisLabel: {
              interval: 0,
              //  rotate: 60,
              color: "#FFFFFF",
              fontSize: "16px",
            },
          },
          yAxis: {
            type: "value",
            name: "水位（m）",
            nameTextStyle: {
              fontWeight: "500",
              fontSize: "16px",
              color: "#FFFFFF",
            },
            axisLabel: {
              color: "#FFFFFF",
              fontSize: "16px",
            },
            splitLine: {
              show: true,
              lineStyle: {
                // type:'dashed',
                color: "rgba(255,255,255,0.2)",
              },
            },
          },
          series: [
            {
              data: seriesData,
              type: "line",
              itemStyle: {
                color: "#78DFFF",
              },
            },
          ],
        };
        option && lineChart.setOption(option);
      }
    });
  });
};
const waterLevelDateChange = () => {
  waterAlysFunction();
};

//获取船闸（连江）
const shipLock1 = ref([]);
const shipLockOptions1 = ref([]);
const getShipLockSmallFunction = () => {
  getShipLockSmall("连江").then((res) => {
    if (res.code === 200) {
      let data = [
        { label: "船闸", value: "船闸", children: [] },
        { label: "水坝", value: "水坝", children: [] },
      ];
      res.data.cz.forEach((item) => {
        data[0].children.push({
          label: item.name,
          value: item.name,
        });
      });
      res.data.sb.forEach((item) => {
        data[1].children.push({
          label: item.name,
          value: item.name,
        });
      });
      shipLockOptions1.value = data;
      shipLock1.value = [
        shipLockOptions1.value[0].value,
        shipLockOptions1.value[0].children[0].value,
      ];

      defInfoFn(); //监测点数据分析
      cycleStatisFunction(); //变形监测观测周期统计
      initVideo1(); //视频监控
      getCycListFunction(); //获取周期
    }
  });
};
const shipLock1Change = () => {
  defInfoFn(); //监测点数据分析
  cycleStatisFunction(); //变形监测观测周期统计
  videoDirectoryFunction1(); //视频监控
  getCycListFunction(); //获取周期
};

//变形监测分析
const radio1 = ref("监测点数据分析");
const radio1Change = () => { };
const defInfoData = ref({});
const defInfoFn = () => {
  defInfo(shipLock1.value[1]).then((res) => {
    if (res.code === 200) {
      defInfoData.value = res.data;
      startAnimation(defInfoData.value.plane, 'plane1');
      startAnimation(defInfoData.value.elevation1, 'elevation1');
      startAnimation(defInfoData.value.lastMonthpm, 'lastMonthpm1');
      startAnimation(defInfoData.value.lastMonthgc, 'lastMonthgc1');
      startAnimation(defInfoData.value.pointNum, 'pointNum1');
      startAnimation(defInfoData.value.arrangeSit, 'arrangeSit1');

    }
  });
};
const cycleStatisxAxisData = ref([]);
const cycleStatisseriesData = ref([]);
const cycleStatisFunction = () => {
  cycleStatis(shipLock1.value[1]).then((res) => {
    cycleStatisxAxisData.value = [];
    cycleStatisseriesData.value = [];
    if (res.code === 200) {
      nextTick(() => {
        res.data.forEach((item) => {
          cycleStatisxAxisData.value.push(item.time);
          cycleStatisseriesData.value.push({
            value: item.cyc,
            itemStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                { offset: 0, color: "#78DFFF" }, // 顶部
                { offset: 1, color: "rgba(120,223,255,0.2)" }, // 底部
              ]),
            },
          }
          );
        });

        let barChart = echarts.getInstanceByDom(
          document.getElementById("tenth-chart")
        );
        if (barChart == null) {
          barChart = echarts.init(document.getElementById("tenth-chart"));
        }
        let option;
        option = {
          tooltip: {
            trigger: "axis",
            axisPointer: {
              type: "shadow",
            },
            confine: true, //限制在图表区域内
            formatter: function (params) {
              let value = params[0].value + "次";
              return (
                params[0].seriesName + "<br/>" + params[0].name + " : " + value
              );
            },
          },
          grid: {
            top: "40px",
            left: "40px",
            right: "12%",
            bottom: "45px",
            containLabel: true,
          },
          dataZoom: [
            {
              show: false,
              type: "inside",
              // maxValueSpan: 8,
              startValue: 0,
              endValue: 5,
              zoomLock: false,
            },
          ],
          xAxis: [
            {
              type: "category",
              data: cycleStatisxAxisData.value,
              // name: "时间",
              // axisTick: {
              //   alignWithLabel: true, //控制刻度线是否与刻度标签对齐
              //   show: false, //是否显示刻度线
              // },
              nameTextStyle: {
                fontWeight: "500",
                fontSize: "16px",
                color: "#FFFFFF",
              },
              axisLabel: {
                interval: 0,
                // rotate: 60,
                color: "rgba(255,255,255,0.85)",
                fontSize: "16px",
                // formatter: function (value) {
                //   //x轴的文字改为竖版显示
                //   var str = value.split("");
                //   return str.join("\n");
                // }
              },
            },
          ],
          yAxis: [
            {
              type: "value",
              name: "统计次数",
              nameTextStyle: {
                fontWeight: "500",
                fontSize: "16px",
                color: "rgba(255,255,255,0.65)",
              },
              axisLabel: {
                color: "rgba(255,255,255,0.65)",
                fontSize: "16px",
              },
              splitLine: {
                show: true,
                lineStyle: {
                  // type:'dashed',
                  color: "rgba(255,255,255,0.2)",
                },
              },
            },
          ],
          series: [
            {
              name: "统计次数",
              data: cycleStatisseriesData.value,
              type: "bar",
              barWidth: 8,
              // label: {
              //   show: true,
              //   position: "top",
              // },
            },
          ],
        };

        option && barChart.setOption(option);
      });
    }
  });
};

//基本情况
const beijiangData = ref({});
const lianjiangData = ref({});
const countDataFn = () => {
  screenMapData().then((res) => {
    if (res.code === 200) {
      beijiangData.value = res.data[0].beijiang;
      lianjiangData.value = res.data[0].lianjiang;
    }
  });
};

//视频监控（北江）
const initVideo = () => {
  nextTick(() => {
    videojs("myVideo", {
      language: "zh-CN", //汉化
      autoplay: true, // true,浏览器准备好时开始播放
      loop: true, // 导致视频一结束就重新开始
      controls: true, //取消视频中的进度条
      muted: true, //是否静音
      preload: "metadata", //auto浏览器选择最佳行为,立即开始加载视频（如果浏览器支持）
      notSupportedMessage: "此视频暂无法播放，请稍后再试", // 无法播放媒体源时显示的默认信息
      textTrackDisplay: false,
      techOrder: ["html5", "flash"],
      controlBar: {
        fullscreenToggle: false, //禁用全屏
      },
    });
  });
  videoDirectoryFunction();
};
const videoPoint = ref("");
const videoDirectoryData = ref([]);
const videoDirectoryFunction = () => {
  videoDirectory(shipLock.value).then((res) => {
    if (res.code === 200 && res.data.length) {
      videoDirectoryData.value = res.data;
      videoPoint.value = res.data[0].id;
      geVideotUrlFunction();
    } else {
      videoDirectoryData.value = [];
      videoPoint.value = "";
    }
  });
};
const geVideotUrlFunction = () => {
  geVideotUrl(videoPoint.value).then((res) => {
    if (res.code === 200 && res.data) {
      const myPlayer = videojs("myVideo");
      myPlayer.src([
        {
          type: "application/x-mpegURL",
          src: res.data.url, //视频播放地址
        },
      ]);
      myPlayer.play();
    }
  });
};
const videoPointChange = () => {
  geVideotUrlFunction();
};

//视频监控（连江）
const initVideo1 = () => {
  nextTick(() => {
    videojs("myVideo1", {
      language: "zh-CN", //汉化
      autoplay: true, // true,浏览器准备好时开始播放
      loop: true, // 导致视频一结束就重新开始
      controls: true, //取消视频中的进度条
      muted: true, //是否静音
      preload: "metadata", //auto浏览器选择最佳行为,立即开始加载视频（如果浏览器支持）
      notSupportedMessage: "此视频暂无法播放，请稍后再试", // 无法播放媒体源时显示的默认信息
      textTrackDisplay: false,
      techOrder: ["html5", "flash"],
      controlBar: {
        fullscreenToggle: false, //禁用全屏
      },
    });
  });
  videoDirectoryFunction1();
};
const videoPoint1 = ref("");
const videoDirectoryData1 = ref([]);
const videoDirectoryFunction1 = () => {
  videoDirectory(shipLock1.value[1]).then((res) => {
    if (res.code === 200 && res.data.length) {
      videoDirectoryData1.value = res.data;
      videoPoint1.value = res.data[0].id;
      geVideotUrlFunction1();
    } else {
      videoDirectoryData1.value = [];
      videoPoint1.value = "";
    }
  });
};
const geVideotUrlFunction1 = () => {
  geVideotUrl(videoPoint1.value).then((res) => {
    if (res.code === 200 && res.data) {
      const myPlayer = videojs("myVideo1");
      myPlayer.src([
        {
          type: "application/x-mpegURL",
          src: res.data.url, //视频播放地址
        },
      ]);
      myPlayer.play();
    }
  });
};
const videoPointChange1 = () => {
  geVideotUrlFunction1();
};

//筛选（船闸）
const checkAll1 = ref(false);
const isIndeterminate1 = ref(false);
const checkedValues1 = ref([]);
const options1 = ["Ⅲ级", "Ⅳ级", "Ⅴ级", "Ⅵ级"];
const handleCheckAllChange1 = (val) => {
  checkedValues1.value = val ? options1 : [];
  isIndeterminate1.value = false;
  handleSure();
};
const handleCheckedCitiesChange1 = (value) => {
  const checkedCount = value.length;
  checkAll1.value = checkedCount === options1.length;
  isIndeterminate1.value = checkedCount > 0 && checkedCount < options1.length;
  handleSure();
};
//筛选（航道）
const checkAll2 = ref(false);
const isIndeterminate2 = ref(false);
const checkedValues2 = ref([]);
const options2 = ["北江", "连江"];
const handleCheckAllChange2 = (val) => {
  checkedValues2.value = val ? options2 : [];
  isIndeterminate2.value = false;
  handleSure();
};
const handleCheckedCitiesChange2 = (value) => {
  const checkedCount = value.length;
  checkAll2.value = checkedCount === options2.length;
  isIndeterminate2.value = checkedCount > 0 && checkedCount < options2.length;
  handleSure();
};
//筛选（辖区）
const checkAll3 = ref(false);
const isIndeterminate3 = ref(false);
const checkedValues3 = ref([]);
const options3 = ["韶关", "清远"];
const handleCheckAllChange3 = (val) => {
  checkedValues3.value = val ? options3 : [];
  isIndeterminate3.value = false;
  handleSure();
};
const handleCheckedCitiesChange3 = (value) => {
  const checkedCount = value.length;
  checkAll3.value = checkedCount === options3.length;
  isIndeterminate3.value = checkedCount > 0 && checkedCount < options3.length;
  handleSure();
};
const handleSure = () => {
  OlArcRef.value.getPositionFn({
    slLevel: checkedValues1.value.join(","),
    hangdao: checkedValues2.value.join(","),
    block: checkedValues3.value.join(","),
  });
};

//变形监测统计分析
const currentActive = ref(1);
const currentActiveChange = (val) => {
  currentActive.value = val;
  singleType.value = "周期";
  if (val === 1) {
    defAylsFunction();
  } else {
    defSingleAylsFunction();
  }
};
const cycle = ref("");
const cycle1 = ref("周期");
const singleType = ref("周期");
const singleTypeData = [
  { text: "周期", value: "周期" },
  { text: "时间", value: "时间" },
];
const singleValue1 = ref("");
const singleValue2 = ref("");
const singleTime = ref([
  new Date().format("yyyy-MM-dd"),
  new Date().format("yyyy-MM-dd"),
]);
const cycleOptions = ref([]);
const currentType1 = ref("累积");
const changeType1 = (val) => {
  currentType1.value = val;
  defAylsFunction();
};
const currentType2 = ref("累积");
const changeType2 = (val) => {
  currentType2.value = val;
  defSingleAylsFunction();
};

const cycleChange = () => {
  defAylsFunction();
};
const singleValueChange = () => {
  defSingleAylsFunction();
};

const getCycListFunction = () => {
  getCycList(shipLock1.value[1]).then((res) => {
    if (res.code === 200) {
      res.data.forEach((item) => {
        item.cycName = `第${item.cyc}周期`;
      });
      cycleOptions.value = res.data;
      if (res.data.length) {
        cycle.value = res.data[0].cycName;
        singleValue1.value = res.data[3].cycName;
        singleValue2.value = res.data[0].cycName;
      } else {
        cycle.value = "";
        singleValue1.value = "";
        singleValue2.value = "";
      }
      defAylsFunction();
    }
  });
};
const pointName = ref("");
const pointNameData = ref([]);
const aylsXAxisData = ref([]);
const aylsSeriesData = ref([]);
const legendData = ref({});
const defAylsFunction = () => {
  defAyls(
    shipLock1.value[1],
    cycle.value.replace("第", "").replace("周期", "")
  ).then((res) => {
    if (res.code === 200) {
      if (res.data.length) {
        let nData = [];
        let eData = [];
        let zData = [];
        let yujing1 = [];
        let yujing2 = [];

        let thisnData = [];
        let thiseData = [];
        let thiszData = [];
        pointNameData.value = [];
        aylsXAxisData.value = [];
        res.data.forEach((item) => {
          pointNameData.value.push({
            text: item.pointName,
            value: item.pointName,
          });
          aylsXAxisData.value.push(item.pointName);
          nData.push(item.acDn);
          eData.push(item.acDe);
          zData.push(item.acDz);
          yujing1.push(30);
          yujing2.push(-30);
          thisnData.push(item.thisDn);
          thiseData.push(item.thisDe);
          thiszData.push(item.thisDz);
        });
        pointName.value = pointNameData.value[0].value;
        if (currentType1.value === "累积") {
          aylsSeriesData.value = [
            {
              name: "累积变化量N",
              type: "line",
              //smooth: true,
              data: nData,
              icon: 'rect',
              itemWidth: 8,
              itemHeight: 8,
              lineStyle: {
                color: "#78DFFF",
              },
            },
            {
              name: "累积变化量E",
              type: "line",
              icon: 'rect',
              //smooth: true,
              data: eData,
              lineStyle: {
                color: "#5AF5D5",
              },
            },
            {
              name: "累积变化量Z",
              type: "line",
              icon: 'rect',
              //smooth: true,
              data: zData,
              lineStyle: {
                color: "#FFC733",
              },
            },
            {
              name: "预警值",
              type: "line",
              icon: 'rect',
              data: yujing1,
              showSymbol: false,
              lineStyle: {
                color: "#F13939",
                width: 1,
                type: "dashed",
              },
            },
            {
              name: "预警值",
              type: "line",
              icon: 'rect',
              data: yujing2,
              showSymbol: false,
              lineStyle: {
                color: "#F13939",
                width: 1,
                type: "dashed",
              },
            },
          ];
          legendData.value = {
            data: [
              "累积变化量N",
              "累积变化量E",
              "累积变化量Z",
              "预警值",
              "预警值",
            ],
            itemWidth: 8,
            itemHeight: 8,
            icon: 'rect',
            textStyle: {
              color: "rgba(255,255,255,0.85)",
            },
          };
        } else if (currentType1.value === "本次") {
          aylsSeriesData.value = [
            {
              name: "本次变化量N",
              type: "line",
              //smooth: true,
              data: thisnData,
              lineStyle: {
                color: "#78DFFF",
              },
            },
            {
              name: "本次变化量E",
              type: "line",
              //smooth: true,
              data: thiseData,
              lineStyle: {
                color: "#5AF5D5",
              },
            },
            {
              name: "本次变化量Z",
              type: "line",
              //smooth: true,
              data: thiszData,
              lineStyle: {
                color: "#FFC733",
              },
            },
          ];
          legendData.value = {
            data: ["本次变化量N", "本次变化量E", "本次变化量Z"],
            itemHeight: 8,
            itemWidth: 8,
            icon: 'rect',
            textStyle: {
              color: "rgba(255,255,255,0.85)",
            },
          };
        }

        initLineChart1();
      } else {
        pointNameData.value = [];
        pointName.value = "";

        aylsXAxisData.value = [];
        aylsSeriesData.value = [];
        initLineChart1();
      }
    }
  });
};
const defSingleAylsFunction = () => {
  defSingleAyls(
    singleType.value === "周期"
      ? singleValue1.value.replace("第", "").replace("周期", "")
      : singleTime.value[0],
    singleType.value === "周期"
      ? singleValue2.value.replace("第", "").replace("周期", "")
      : singleTime.value[1],
    singleType.value === "周期" ? 1 : 2,
    pointName.value,
    shipLock1.value[1]
  ).then((res) => {
    if (res.code === 200) {
      let nData = [];
      let eData = [];
      let zData = [];
      let yujing1 = [];
      let yujing2 = [];

      let thisnData = [];
      let thiseData = [];
      let thiszData = [];
      aylsXAxisData.value = [];
      res.data.forEach((item) => {
        if (singleType.value === 2) {
          aylsXAxisData.value.push(item.createTime);
        } else {
          aylsXAxisData.value.push(item.cyc);
        }

        nData.push(item.acDn);
        eData.push(item.acDe);
        zData.push(item.acDz);
        yujing1.push(30);
        yujing2.push(-30);
        thisnData.push(item.thisDn);
        thiseData.push(item.thisDe);
        thiszData.push(item.thisDz);
      });

      if (currentType2.value === "累积") {
        aylsSeriesData.value = [
          {
            name: "累积变化量N",
            type: "line",
            //smooth: true,
            data: nData,
            lineStyle: {
              color: "#78DFFF",
            },
          },
          {
            name: "累积变化量E",
            type: "line",
            //smooth: true,
            data: eData,
            lineStyle: {
              color: "#5AF5D5",
            },
          },
          {
            name: "累积变化量Z",
            type: "line",
            //smooth: true,
            data: zData,
            lineStyle: {
              color: "#FFC733",
            },
          },
          {
            name: "预警值",
            type: "line",
            data: yujing1,
            showSymbol: false,
            lineStyle: {
              color: "#F13939",
              width: 1,
              type: "dashed",
            },
          },
          {
            name: "预警值",
            type: "line",
            data: yujing2,
            showSymbol: false,
            lineStyle: {
              color: "#F13939",
              width: 1,
              type: "dashed",
            },
          },
        ];
        legendData.value = {
          data: [
            "累积变化量N",
            "累积变化量E",
            "累积变化量Z",
            "预警值",
            "预警值",
          ],
          textStyle: {
            color: "rgba(255,255,255,0.85)",
          },
          itemWidth: 8,  // 设置正方形的宽度
          itemHeight: 8, // 设置正方形的高度
          icon: 'rect',
        };
      } else if (currentType2.value === "本次") {
        aylsSeriesData.value = [
          {
            name: "本次变化量N",
            type: "line",
            //smooth: true,
            data: thisnData,
            itemHeight: 8,
            itemWidth: 8,
            icon: 'rect',
            lineStyle: {
              color: "#78DFFF",
            },
          },
          {
            name: "本次变化量E",
            type: "line",
            //smooth: true,
            data: thiseData,
            itemHeight: 8,
            itemWidth: 8,
            icon: 'rect',
            lineStyle: {
              color: "#5AF5D5",
            },
          },
          {
            name: "本次变化量Z",
            type: "line",
            itemHeight: 8,
            itemWidth: 8,
            icon: 'rect',
            //smooth: true,
            data: thiszData,
            lineStyle: {
              color: "#FFC733",
            },
          },
        ];
        legendData.value = {
          data: ["本次变化量N", "本次变化量E", "本次变化量Z"],
          textStyle: {
            color: "rgba(255,255,255,0.85)",
          },
        };
      }
      initLineChart1();
    }
  });
};
const initLineChart1 = () => {
  nextTick(() => {
    let lineChart = echarts.getInstanceByDom(
      document.getElementById("ninth-chart")
    );
    if (lineChart != null && lineChart != "" && lineChart != undefined) {
      lineChart.dispose();
    }
    lineChart = echarts.init(document.getElementById("ninth-chart"));
    let option;
    option = {
      grid: {
        top: "25%",
        left: "40px",
        right: "15px",
        bottom: "40px",
      },
      tooltip: {
        trigger: "axis",
        confine: true, //限制在图表区域内

        formatter: function (params) {
          let template = `<b>${params[0].axisValue}</b><br>`;
          for (let i = 0; i < 3; i++) {
            let item = params[i];
            template +=
              item.marker +
              item.seriesName +
              ": " +
              `<b style="float:right;padding-left: 20px;">${item.data}mm</b><br>`;
          }
          return template;
        },
      },
      legend: legendData.value,
      xAxis: {
        type: "category",
        data: aylsXAxisData.value,
        axisLabel: {
          interval: 0,
          color: "#FFFFFF",
          opacity: 0.85,
          fontSize: "16px",
        },
        nameTextStyle: {
          fontWeight: "500",
          fontSize: "16px",
          color: "#FFFFFF",
          opacity: 0.65,
        },
        axisLine: {
          onZero: true, // 将X轴在Y轴0刻度的位置固定
        },
      },
      yAxis: {
        type: "value",
        name: "单位：mm",
        axisLabel: {
          interval: 0,
          color: "#FFFFFF",
          opacity: 0.65,
          fontSize: "16px",
        },
        nameTextStyle: {
          fontWeight: "500",
          fontSize: "16px",
          color: "#FFFFFF",
          opacity: 0.65,
        },
        splitLine: {
          show: true,
          lineStyle: {
            // type:'dashed',
            color: "rgba(255,255,255,0.2)",
          },
        },
      },
      series: aylsSeriesData.value,
    };

    option && lineChart.setOption(option);
  });
};

//是否显示iframe
const isShow = ref(false);

onMounted(() => {
  document.title = "闸坝智能调度与安全监测";
  waterLevelDate.value = new Date().format("yyyy-MM-dd");
  newWaterFunctin(); //实时水位统计分析
  initStackedChart(); //过闸船舶货物吨位统计
  initPieChart(); //过闸船舶货物类型统计分析
  deformationAlysFunction(); //变形监测统计分析
  circleAlysFunction(); //变形监测观测周期统计分析
  getShipLockFunction(); //获取船闸（北江）
  getShipLockSmallFunction(); //获取船闸（连江）
  countDataFn(); //基本情况
});

onUnmounted(() => {
  // 清除所有定时器，防止内存泄漏
  if (window.legendScrollTimer) {
    clearInterval(window.legendScrollTimer);
    window.legendScrollTimer = null;
  }

  if (window.legendScrollTimer1) {
    clearInterval(window.legendScrollTimer1);
    window.legendScrollTimer1 = null;
  }

  // 清除其他可能的定时器
  if (window.timer) {
    clearInterval(window.timer);
    window.timer = null;
  }

  if (window.scrollInterval) {
    clearInterval(window.scrollInterval);
    window.scrollInterval = null;
  }
});
</script>

<style lang="scss" scoped>
@font-face {
  font-family: Din;
  src: url("../assets/fonts/din.ttf");
}

@font-face {
  font-family: Tx;
  src: url("../assets/fonts/tx.ttf");
}

/* 全局动画定义 */
@keyframes rotate {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 400% 50%;
  }
}

@keyframes shadowMove {
  0% {
    background-position: 0% 50%;
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    background-position: 400% 50%;
    opacity: 0.6;
  }
}

.container {
  width: 5760px;
  height: 1200px;
  transform-origin: 0 0;
  position: relative;
  background: #012138;

  .main {
    width: 100%;
    height: 100%;
    position: absolute;

    .content {
      display: flex;
      box-sizing: content-box;

      .left-content {
        width: 1648px;

        .item-content {
          height: 520px;
          box-sizing: content-box;
          background-color: #06324f;

          .item-content-title {
            background-image: url("../assets/images/big-screen/one-title-bg.png");
            background-size: 100% 100%;
            background-repeat: no-repeat;
            font-family: "Tx";
            color: #fff;
            font-size: 26px;
            font-weight: 400;
            height: 40px;
            line-height: 40px;
            padding: 8px 0px 8px 28px;
            display: flex;
            align-items: center;
            justify-content: space-between;
          }

          .item {
            .top {
              background-image: url("../assets/images/big-screen/two-title-bg.png");
              background-size: 100% 100%;
              background-repeat: no-repeat;
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding: 7px 0px;
              margin-bottom: 24px;

              .title {
                font-family: "Tx";
                font-size: 24px;
                color: #fff;
                padding-left: 32px;
              }

              .time {
                font-size: 18px;
                color: #bebebe;
              }

              .no-active {
                font-size: 24px;
                color: rgba(255, 255, 255, 0.65);
              }
            }

            .count {
              display: flex;
              justify-content: space-around;
              align-items: center;
              margin-top: 8px;
              height: 44px;

              .count-item {
                display: flex;
                align-items: center;

                .name {
                  font-size: 16px;
                  font-weight: 500;
                  color: rgba(255, 255, 255, 0.65);
                }

                .value {
                  font-family: "Din";
                  font-size: 28px;
                  font-weight: bold;
                  color: #fff;
                  padding-left: 8px;
                }
              }
            }

            .pie-table {
              height: 120px;
              // overflow-y: scroll;
              padding: 0 16px;

              .pie-tbody {
                font-size: 11px;
                font-weight: 500;
                color: #fff;
                overflow: hidden;
                margin-top: -193px;
                margin-right: -248px;
                white-space: nowrap;

                .pie-tr {
                  display: flex;
                  align-items: center;
                  justify-content: space-around;

                  .li {
                    width: 8px;
                    height: 8px;
                    border-radius: 0px 0px 0px 0px;
                    opacity: 1;
                    margin-right: 6px;
                  }
                }
              }

              .pie-tbody1 {
                font-size: 14px;
                font-weight: 500;
                color: #fff;
                overflow: hidden;
                margin-top: -106px;
                margin-right: -231px;

                .pie-tr {
                  display: flex;
                  align-items: center;
                  justify-content: space-around;

                  .li {
                    width: 8px;
                    height: 8px;
                    border-radius: 0px 0px 0px 0px;
                    opacity: 1;
                    margin-right: 6px;
                  }
                }
              }
            }

            .tab-content {
              .date {
                font-weight: 400;
                font-size: 18px;
                color: rgba(255, 255, 255, 0.65);
                height: 44px;
                line-height: 44px;
                margin-top: 8px;
              }

              .radio-value {
                height: 28px;
                text-align: center;
              }

              #sixth-chart {
                height: 280px;
              }

              #seventh-chart {
                height: 300px;
                width: 360px;
              }

              #eighth-chart {
                height: 320px;
                width: 744px;
              }
            }

            .no-video {
              display: flex;
              justify-content: center;
              align-items: center;
              height: 352px;
              flex-direction: column;

              .default-img {
                img {
                  height: 100px;
                  width: 200px;
                }
              }

              .default-text {
                color: #fff;
                font-size: 16px;
                margin-top: 8px;
              }
            }

            #first-chart {
              height: 352px;
              width: 100%;
            }

            #second-chart {
              height: 300px;
              width: 100%;
            }

            #third-chart {
              height: 220px;
              width: 100%;
            }
          }
        }
      }

      .centre-content {
        width: 2464px;
        height: 1080px;
        margin: 40px 0px;
        position: relative;

        .special-topic {
          position: absolute;
          top: 42px;
          left: 10px;
          font-family: "Tx";
          font-weight: 400;
          font-size: 18px;
          color: #ffffff;

          .topic {
            width: 286px;
            height: 40px;
            background-image: url("../assets/images/big-screen/topic-bg.png");
            background-size: 100% 100%;
            background-repeat: no-repeat;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 24px;
            color: rgba(255, 255, 255, 0.65);
          }

          .topic:hover {
            width: 286px;
            height: 40px;
            background-image: url("../assets/images/big-screen/topic-active-bg.png");
            background-size: 100% 100%;
            background-repeat: no-repeat;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 24px;
          }

          .topic-active {
            width: 286px;
            height: 40px;
            background-image: url("../assets/images/big-screen/topic-active-bg.png");
            background-size: 100% 100%;
            background-repeat: no-repeat;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 24px;
          }
        }

        .legend {
          width: 288px;
          height: 122px;
          background: rgba(5, 48, 68, 0.8);
          border-radius: 4px;
          position: absolute;
          top: 42px;
          right: 10px;
          overflow: hidden;
          border: none;

          &::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 4px;
            padding: 1px;
            background: linear-gradient(
              90deg,
              #78dfff 0%,
              #5af5d5 25%,
              #33ebff 50%,
              #309cff 75%,
              #78dfff 100%
            );
            background-size: 300% 100%;
            -webkit-mask: linear-gradient(#fff 0 0) content-box,
              linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            animation: rotate 3s linear infinite;
            box-shadow: 0 0 20px rgba(120, 223, 255, 0.5);
          }

          &::after {
            content: "";
            position: absolute;
            z-index: -1;
            left: 5%;
            bottom: -5px;
            width: 90%;
            height: 10px;
            filter: blur(12px);
            background: linear-gradient(
              90deg,
              #78dfff 0%,
              #5af5d5 25%,
              #33ebff 50%,
              #309cff 75%,
              #78dfff 100%
            );
            background-size: 300% 100%;
            animation: shadowMove 3s linear infinite;
            opacity: 0.6;
          }

          &:hover::before,
          &:hover::after {
            animation-play-state: paused;
          }

          .legend-item {
            display: flex;
            align-items: center;
            font-size: 18px;
            font-weight: 400;
            color: #fff;
            margin: 20px 0px 20px 24px;

            img {
              width: 26px;
              height: 26px;
              padding-right: 8px;
            }
          }
        }

        .filter {
          height: 450px;
          width: 288px;
          box-sizing: content-box;
          background: rgba(5, 48, 68, 0.8);
          border-radius: 4px;
          position: absolute;
          top: 180px;
          right: 10px;
          overflow: hidden;
          border: none;

          &::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 4px;
            padding: 1px;
            background: linear-gradient(
              90deg,
              #78dfff 0%,
              #5af5d5 25%,
              #33ebff 50%,
              #309cff 75%,
              #78dfff 100%
            );
            background-size: 300% 100%;
            -webkit-mask: linear-gradient(#fff 0 0) content-box,
              linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            animation: rotate 3s linear infinite;
            animation-delay: 0.5s;
            box-shadow: 0 0 20px rgba(120, 223, 255, 0.5);
          }

          &::after {
            content: "";
            position: absolute;
            z-index: -1;
            left: 5%;
            bottom: -5px;
            width: 90%;
            height: 10px;
            filter: blur(12px);
            background: linear-gradient(
              90deg,
              #78dfff 0%,
              #5af5d5 25%,
              #33ebff 50%,
              #309cff 75%,
              #78dfff 100%
            );
            background-size: 300% 100%;
            animation: shadowMove 3s linear infinite;
            animation-delay: 0.5s;
            opacity: 0.6;
          }

          &:hover::before,
          &:hover::after {
            animation-play-state: paused;
          }

          .filter-item {
            .name {
              color: #78dfff;
              font-size: 16px;
              font-weight: bold;
            }
          }
        }

        .statistics {
          position: absolute;
          top: 646px;
          right: 10px;

          .statistics-item {
            height: 146px;
            width: 288px;
            background: rgba(5, 48, 68, 0.8);
            border-radius: 4px;
            color: #fff;
            font-size: 18px;
            font-weight: 400;
            overflow: hidden;
            position: relative;
            border: none;

            &::before {
              content: "";
              position: absolute;
              top: 0;
              left: 0;
              right: 0;
              bottom: 0;
              border-radius: 4px;
              padding: 1px;
              background: linear-gradient(
                90deg,
                #78dfff 0%,
                #5af5d5 25%,
                #33ebff 50%,
                #309cff 75%,
                #78dfff 100%
              );
              background-size: 300% 100%;
              -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
              -webkit-mask-composite: xor;
              mask-composite: exclude;
              animation: rotate 3s linear infinite;
              box-shadow: 0 0 20px rgba(120, 223, 255, 0.5);
            }

            &::after {
              content: "";
              position: absolute;
              z-index: -1;
              left: 5%;
              bottom: -5px;
              width: 90%;
              height: 10px;
              filter: blur(12px);
              background: linear-gradient(
                90deg,
                #78dfff 0%,
                #5af5d5 25%,
                #33ebff 50%,
                #309cff 75%,
                #78dfff 100%
              );
              background-size: 300% 100%;
              animation: shadowMove 3s linear infinite;
              opacity: 0.6;
            }

            &:hover::before,
            &:hover::after {
              animation-play-state: paused;
            }

            .top-info {
              margin: 20px 0px 8px 24px;
            }

            .bottom-info {
              display: flex;
              margin: 0px 24px 20px 24px;

              .value {
                font-size: 28px;
                margin-top: 4px;
              }
            }

            &:first-child {
              margin-bottom: 16px;
            }
          }
        }
      }

      .right-content {
        width: 1648px;

        .item-content {
          height: 520px;
          box-sizing: content-box;
          background-color: #06324f;

          .item-content-title {
            background-image: url("../assets/images/big-screen/one-title-bg.png");
            background-size: 100% 100%;
            background-repeat: no-repeat;
            font-family: "Tx";
            color: #fff;
            font-size: 26px;
            font-weight: 400;
            height: 40px;
            line-height: 40px;
            padding: 8px 0px 8px 28px;
            display: flex;
            align-items: center;
            justify-content: space-between;
          }
          .item {
            width: 50%;
            height: 50px; /* 每个项的高度 */
            margin-bottom: 10px;
            .top {
              background-image: url(/src/assets/images/big-screen/two-title-bg.png);
              background-size: 100% 100%;
              background-repeat: no-repeat;
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding: 7px 0px;
              margin-bottom: 24px;
              margin-left: -17px;
              .title {
                font-family: "Tx";
                font-size: 24px;
                color: rgba(255, 255, 255, 1);
                padding-left: 32px;
              }

              .time {
                font-size: 18px;
                color: #bebebe;
              }
            }
            .top1 {
              background-image: url("../assets/images/big-screen/two-title-bg.png");
              background-size: 100% 100%;
              background-repeat: no-repeat;
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding: 7px 0px;
              width: 435px;
              margin-bottom: 24px;

              .title {
                font-family: "Tx";
                font-size: 24px;
                color: rgba(255, 255, 255, 1);
                padding-left: 32px;
              }

              .time {
                font-size: 18px;
                color: #bebebe;
              }
            }
            .top2 {
              background-image: url("../assets/images/big-screen/two-title-bg.png");
              background-size: 100% 100%;
              background-repeat: no-repeat;
              display: flex;
              justify-content: space-between;
              align-items: center;
              padding: 7px 0px;
              margin-bottom: 24px;
              margin-left: -264px;
              width: 1114px;
              .title {
                font-family: "Tx";
                font-size: 24px;
                color: rgba(255, 255, 255, 1);
                padding-left: 32px;
              }

              .time {
                font-size: 18px;
                color: #bebebe;
              }
            }
            .list {
              height: 373px;
              margin-top: -15px;
              width: 670px;
              overflow: hidden;
              position: relative;
              .scroll-container {
                width: 100%; /* 根据需要设置宽度 */
                height: 600px; /* 根据内容设置高度 */
                overflow: hidden; /* 隐藏溢出部分 */
              }
              .scroll-content {
                display: flex; /* 使用 flexbox 垂直排列项 */
                flex-direction: column; /* 垂直排列 */
                animation: scroll 50s linear infinite; /* 15秒完成一次滚动 */
              }

              @keyframes scroll {
                0% {
                  transform: translateY(0); /* 从初始位置开始 */
                }
                100% {
                  transform: translateY(-700px); /* 向上滑动一个项的高度 */
                }
              }

              .list-item {
                width: 61%;
                margin: 0 1%;

                .item-title {
                  font-weight: 800;
                  font-size: 16px;
                  color: #78dfff;
                  background: #164966;
                  text-align: center;
                  padding: 2px 0;
                }

                .item-name {
                  display: flex;

                  div {
                    width: 25%;
                    padding: 2px 0;
                    font-weight: 500;
                    font-size: 14px;
                    color: #ffffff;
                    background: #225a78;
                    text-align: center;
                  }
                }

                .item-value {
                  display: flex;

                  div {
                    width: 25%;
                    padding: 2px 0;
                    font-weight: 400;
                    font-size: 14px;
                    color: #ffffff;
                    background: #10405d;
                    text-align: center;
                  }
                }
              }
            }

            .tabs-content {
              height: 352px;
              box-sizing: content-box;

              .radio-tab {
                height: 52px;
                text-align: center;
              }

              #fourth-chart {
                left: -261px;
                top: -11px;
                width: 1051px;
                height: 328px;
                margin-top: -11px;
              }
              #fifth-chart {
                left: -261px;
                top: -11px;
                width: 1051px;
                height: 328px;
                margin-top: -11px;
              }

              #tenth-chart {
                height: 352px;
                width: 744px;
              }

              .point-statistics {
                .point-item {
                  background-image: url("../assets/images/big-screen/bg.png");
                  background-size: 100% 100%;
                  background-repeat: no-repeat;
                  width: 350px;

                  .top-part {
                    margin: 30px 0px 24px 24px;
                    display: flex;
                    align-items: center;
                    font-weight: 500;
                    font-size: 18px;
                    color: #ffffff;

                    .ml16 {
                      margin-left: 16px;
                      color: rgba(255, 255, 255, 0.85);
                    }

                    .value {
                      font-family: "Din";
                      font-weight: bold;
                      font-size: 28px;
                      color: #ffffff;
                    }

                    .name {
                      font-weight: bold;
                      font-size: 28px;
                      color: #ffffff;
                      margin-left: 8px;
                    }
                  }

                  .bottom-part {
                    margin: 0px 0px 24px 24px;
                    display: flex;
                    margin-left: 79px;
                    .name {
                      font-weight: 500;
                      font-size: 16px;
                      color: rgba(255, 255, 255, 0.85);
                    }

                    .value {
                      font-family: "Din";
                      font-weight: bold;
                      font-size: 28px;
                      color: #ffffff;
                    }

                    .mr60 {
                      margin-right: 60px;
                    }
                  }
                  .bottom-part1 {
                    margin: 0px 0px 24px 24px;
                    display: flex;
                    margin-left: 42px;
                    .name {
                      font-weight: 500;
                      font-size: 16px;
                      color: rgba(255, 255, 255, 0.85);
                    }

                    .value {
                      font-family: "Din";
                      font-weight: bold;
                      font-size: 28px;
                      color: #ffffff;
                    }

                    .mr60 {
                      margin-right: 60px;
                    }
                  }
                }

                .h195 {
                  height: 195px;
                }

                .h125 {
                  height: 130px;
                }

                .mr24 {
                  margin-right: 24px;
                }
              }
              .analysis {
                .top-part {
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  .btn-group {
                    display: flex;
                    justify-content: center;
                    margin-right: 16px;
                    .btn {
                      padding: 8px;
                      color: #fff;
                    }
                    .active {
                      color: #f7f1f1;
                      background-color: #78dfff;
                      // border: 1px solid #78dfff;
                    }
                  }
                  .my-btn {
                    display: flex;
                    // margin-left: 656px;
                    // position: absolute;
                    // margin-top: -17px;
                    height: 32px;

                    .btn {
                      margin-right: 5px;
                      color: rgba(255, 255, 255, 0.85);
                      border: 1px solid #fff;
                      padding: 0 8px;
                      display: flex;
                      align-items: center;
                    }

                    .active {
                      color: #262626;
                      background-color: #78dfff;
                      border: 1px solid #78dfff;
                    }
                  }
                }
              }
            }

            .no-video {
              display: flex;
              justify-content: center;
              align-items: center;
              height: 352px;
              flex-direction: column;

              .default-img {
                img {
                  height: 100px;
                  width: 200px;
                }
              }

              .default-text {
                color: #fff;
                font-size: 16px;
                margin-top: 8px;
              }
            }
          }
        }
      }
    }

    .my-iframe {
      .close-btn {
        font-family: "Tx";
        position: absolute;
        top: 40px;
        left: 1940px;
        color: #ffffff;
        font-size: 20px;
        background-image: url("../assets/images/big-screen/back-bg.png");
        background-size: 100% 100%;
        background-repeat: no-repeat;
        width: 236px;
        height: 44px;
        line-height: 44px;
        text-align: center;
      }
    }
  }
}

// 表单样式
:deep(.el-form-item__label) {
  color: #06283e;
}

:deep(.el-input__inner) {
  color: #78dfff;
  background: transparent;
}

:deep(.el-input__wrapper) {
  background-color: transparent;
  box-shadow: 0 0 0 1px #06283e inset;
}

:deep(.el-range-editor--small .el-range-separator) {
  color: #78dfff;
}

:deep(.el-input__inner::placeholder) {
  color: #78dfff;
}

:deep(.el-select .el-input .el-select__caret.el-icon) {
  color: #78dfff;
}

:deep(.el-date-editor .el-range__icon) {
  color: #78dfff;
}

:deep(.el-range-input::placeholder) {
  color: #78dfff;
}

:deep(.el-range-editor--small .el-range-input) {
  color: #78dfff;
}

:deep(.el-cascader .el-input .el-input__suffix-inner .el-icon svg) {
  color: #78dfff;
}

:deep(.el-radio-button__inner) {
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: 1px solid #d9d9d9;
}

:deep(.el-radio-button__original-radio:checked + .el-radio-button__inner) {
  color: #262626;
  background-color: #78dfff;
  border: 1px solid #78dfff;
}

:deep(.el-checkbox) {
  font-weight: 400;
  --el-checkbox-font-size: 18px;
  // color: rgba(255,255,255,0.65);
  color: #fff;
}

:deep(.el-checkbox__inner) {
  background-color: #d8d8d8;
}

:deep(.el-checkbox__input.is-checked + .el-checkbox__label) {
  color: #78dfff;
}

:deep(.el-checkbox__input.is-indeterminate .el-checkbox__inner) {
  background-color: #78dfff;
  border-color: #78dfff;
}

:deep(.el-checkbox__input.is-checked .el-checkbox__inner) {
  background-color: #78dfff;
  border-color: #78dfff;
}

:deep(.el-checkbox__inner::after) {
  box-sizing: content-box;
  content: "";
  border: 1px solid black;
  border-left: 0;
  border-top: 0;
  height: 7px;
  left: 4px;
  position: absolute;
  top: 1px;
  transform: rotate(45deg) scaleY(0);
  width: 3px;
  transition: transform 0.15s ease-in 50ms;
  transform-origin: center;
}

:deep(.el-checkbox__input.is-indeterminate .el-checkbox__inner::before) {
  content: "";
  position: absolute;
  display: block;
  background-color: black;
  height: 2px;
  transform: scale(0.5);
  left: 0;
  right: 0;
  top: 5px;
}

:deep(.el-date-editor .el-range__icon) {
  display: none;
}

:deep(.el-input.is-disabled .el-input__wrapper) {
  background-color: transparent;
  box-shadow: 0 0 0 1px #06283e inset;
}

:deep(.el-input.is-disabled .el-input__inner) {
  -webkit-text-fill-color: #78dfff;
}

:deep(.el-date-editor .el-range-input) {
  color: #78dfff;
}

:deep(.el-date-editor .el-range-separator) {
  color: #78dfff;
}

:deep(.el-input__prefix) {
  display: none;
}

//滚动条样式
::-webkit-scrollbar {
  width: 0px !important;
}

:deep(.el-select__wrapper) {
  background-color: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  // position: absolute;
  // margin-left: 98px;
  // margin-top: -13px;
  // width: 137px;
  // height: 32px;
}

:deep(.el-select__placeholder) {
  color: #78dfff;
  line-height: 32px;
}

:deep(.el-icon svg) {
  color: #78dfff;
}

:deep(
    .el-radio-button.is-active
      .el-radio-button__original-radio:not(:disabled)
      + .el-radio-button__inner
  ) {
  color: #262626;
  background-color: #78dfff;
  border: 1px solid #78dfff;
}
:deep(.el-select .el-select-dropdown) {
  background-color: rgba(5, 43, 68, 0.8) !important; /* 设置下拉菜单背景颜色 */
  border: 1px solid rgba(120, 223, 255, 0.5); /* 可选：设置边框颜色 */
}
.one-ship {
  width: 200px;
}
.icon-background {
  display: flex; /* 使用 Flex 布局 */
  align-items: center; /* 垂直居中 */
  gap: 10px; /* 图标与文字之间的间距 */
}

.icon {
  width: 24px; /* 图标宽度 */
  height: 24px; /* 图标高度 */
  position: absolute;
  margin-left: 430px;
}
.icon-background1 {
  display: flex; /* 使用 Flex 布局 */
  align-items: center; /* 垂直居中 */
  gap: 10px; /* 图标与文字之间的间距 */
}

.icon {
  width: 24px; /* 图标宽度 */
  height: 24px; /* 图标高度 */
  position: absolute;
  margin-left: 463px;
  margin-top: -1px;
}
.content-container {
  display: flex;
  .el-input {
    width: 80px;
    margin-right: 10px;
  }
  .el-select-wrapper {
    width: 80px;
  }
}
/* 第一个光效 - 优化版 */
.shimmer-container {
  width: 500px;
  height: 15px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.03),
    rgba(9, 30, 66, 0.08),
    rgba(0, 0, 0, 0.03)
  );
  overflow: hidden;
  position: absolute;
  z-index: 0;
  margin-left: -9px;
  margin-top: 42px;
  border-radius: 3px;
}
.shimmer-container::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: -220px;
  width: 220px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0, 183, 255, 0) 0%,
    rgba(0, 183, 255, 0.5) 20%,
    rgba(95, 242, 255, 0.8) 50%,
    rgba(0, 183, 255, 0.5) 80%,
    rgba(0, 183, 255, 0) 100%
  );
  opacity: 0.9;
  transform: skewX(-30deg);
  z-index: 1;
  animation: shimmer 3.5s infinite ease-in-out;
}

@keyframes shimmer {
  0% {
    left: -220px;
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 720px;
    opacity: 0.3;
  }
}

@media (max-width: 600px) {
  .shimmer-container {
    width: 85%;
    margin: 20px auto;
    box-shadow: 0 2px 10px rgba(0, 195, 255, 0.3);
  }
  @keyframes shimmer {
    0% {
      left: -220px;
      opacity: 0.3;
    }
    50% {
      opacity: 1;
    }
    100% {
      left: calc(100% + 220px);
      opacity: 0.3;
    }
  }
}

//第二个光效 - 优化版
.shimmer-container1 {
  width: 760px;
  height: 15px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.05),
    rgba(9, 30, 66, 0.1),
    rgba(0, 0, 0, 0.05)
  );
  overflow: hidden;
  position: absolute;
  z-index: 0;
  margin-left: -1px;
  margin-top: 42px;
  border-radius: 3px;
}

.shimmer-container1::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0, 183, 255, 0) 0%,
    rgba(0, 183, 255, 0.5) 20%,
    rgba(95, 242, 255, 0.8) 50%,
    rgba(0, 183, 255, 0.5) 80%,
    rgba(0, 183, 255, 0) 100%
  );
  transform: skewX(-35deg);
  animation: shimmer1 3.5s infinite ease-in-out;
  z-index: 1;
}

@keyframes shimmer1 {
  0% {
    left: -250px;
    opacity: 0.4;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    left: 1010px;
    opacity: 0.4;
  }
}

@media (max-width: 600px) {
  .shimmer-container1 {
    width: 85%;
    margin: 20px auto;
  }
  @keyframes shimmer1 {
    0% {
      left: -250px;
      opacity: 0.4;
    }
    50% {
      opacity: 0.9;
    }
    100% {
      left: calc(100% + 250px);
      opacity: 0.4;
    }
  }
}

//第三个光效 - 优化版
.shimmer-container2 {
  width: 1160px;
  height: 15px;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.02),
    rgba(23, 43, 77, 0.08),
    rgba(0, 0, 0, 0.02)
  );
  overflow: hidden;
  position: absolute;
  z-index: 0;
  margin-left: -34px;
  margin-top: 1px;
  border-radius: 3px;
}

.shimmer-container2::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(0, 128, 255, 0) 0%,
    rgba(0, 128, 255, 0.2) 20%,
    rgba(0, 217, 255, 0.8) 50%,
    rgba(0, 128, 255, 0.2) 80%,
    rgba(0, 128, 255, 0) 100%
  );
  transform: skewX(-30deg);
  animation: shimmer2 3.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

@keyframes shimmer2 {
  0% {
    left: -300px;
    opacity: 0.4;
  }
  40%,
  60% {
    opacity: 1;
  }
  100% {
    left: 1460px;
    opacity: 0.4;
  }
}

@media (max-width: 600px) {
  .shimmer-container2 {
    width: 85%;
    margin: 20px auto;
  }
  @keyframes shimmer2 {
    0% {
      left: -300px;
      opacity: 0.4;
    }
    40%,
    60% {
      opacity: 1;
    }
    100% {
      left: calc(100% + 300px);
      opacity: 0.4;
    }
  }
}
</style>

